From 5b9dea6a29faf4e1722dcc9d7437141c8a937a14 Mon Sep 17 00:00:00 2001 From: Jokler Date: Sun, 12 Jan 2020 23:05:45 +0100 Subject: Fix error that occurs on incorrect play command --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index eced5db..1207d87 100644 --- a/src/main.rs +++ b/src/main.rs @@ -185,8 +185,12 @@ impl Application { } } Some("play") => { + let playlist = self.playlist.lock().expect("Mutex was not poisoned"); + if !self.player.is_started() { - self.player.stop_current(); + if !playlist.is_empty() { + self.player.stop_current(); + } } else { self.player.play()?; } -- cgit v1.2.3-70-g09d2