summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
Diffstat (limited to 'binding')
-rw-r--r--binding/afm-mediaplayer-binding.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 56213cb..10580e3 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -228,9 +228,14 @@ static void audio_playlist(struct afb_req request)
static int seek_track(int cmd)
{
- GList *item = (cmd == NEXT_CMD) ? current_track->next : current_track->prev;
+ GList *item = NULL;
int ret;
+ if (current_track == NULL)
+ return -EINVAL;
+
+ item = (cmd == NEXT_CMD) ? current_track->next : current_track->prev;
+
if (item == NULL)
return -EINVAL;