summaryrefslogtreecommitdiff
path: root/plugins/m3u
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-12-04 19:09:35 +0100
committerGravatar waker <wakeroid@gmail.com>2011-12-04 19:09:35 +0100
commitc562bf002073a0085cd149a70098b51e86285728 (patch)
treec71b281577f0a9f248f57ce302214f19aa8e82bb /plugins/m3u
parent4686c2f8229b549412b20f3c5c1f73118fc6fa78 (diff)
m3u: fixed crash when file from playlist doesn't exist
Diffstat (limited to 'plugins/m3u')
-rw-r--r--plugins/m3u/m3u.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c
index 34f00ca4..f3949e17 100644
--- a/plugins/m3u/m3u.c
+++ b/plugins/m3u/m3u.c
@@ -129,17 +129,19 @@ load_m3u (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab
if (strrchr (nm, '/')) {
trace ("pl_insert_m3u: adding file %s\n", nm);
it = deadbeef->plt_insert_file (plt, after, nm, pabort, cb, user_data);
- if (length >= 0) {
- deadbeef->plt_set_item_duration (plt, it, length);
- }
- if (title[0]) {
- deadbeef->pl_replace_meta (it, "title", title);
- }
- else if (artist[0]) {
- deadbeef->pl_replace_meta (it, "title", " ");
- }
- if (artist[0]) {
- deadbeef->pl_replace_meta (it, "artist", artist);
+ if (it) {
+ if (length >= 0) {
+ deadbeef->plt_set_item_duration (plt, it, length);
+ }
+ if (title[0]) {
+ deadbeef->pl_replace_meta (it, "title", title);
+ }
+ else if (artist[0]) {
+ deadbeef->pl_replace_meta (it, "title", " ");
+ }
+ if (artist[0]) {
+ deadbeef->pl_replace_meta (it, "artist", artist);
+ }
}
}
else {