Browse files

lib: Check if the track is NULL before accessing it

  • Loading branch information...
1 parent 6d9dca7 commit 1c8b1eb5b1a7d1f0d1c038877856e4ee1354d0c0 @SimonKagstrom committed Jan 23, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/lib/despotify.c
View
7 src/lib/despotify.c
@@ -466,9 +466,12 @@ void despotify_next(struct despotify_session* ds)
return;
/* find next playable track */
- do {
+ while (ds->track)
+ {
ds->track = ds->track->next;
- } while (ds->track && !ds->track->playable);
+ if (ds->track->playable)
+ break;
+ }
if (ds->track)
despotify_play(ds, ds->track, ds->play_as_list);

0 comments on commit 1c8b1eb

Please sign in to comment.