diff --git a/src/main/java/musicplayer/player/GStreamerPlayer.java b/src/main/java/musicplayer/player/GStreamerPlayer.java index e4b206c..c2ed7c6 100644 --- a/src/main/java/musicplayer/player/GStreamerPlayer.java +++ b/src/main/java/musicplayer/player/GStreamerPlayer.java @@ -67,7 +67,8 @@ public class GStreamerPlayer implements IPlayer{ } private void resetSeek(){ - callbackInterface.setSeekBarPosition(0); + if(callbackInterface != null) + callbackInterface.setSeekBarPosition(0); } public void play() throws StartPlayingException { @@ -106,7 +107,8 @@ public class GStreamerPlayer implements IPlayer{ while (true) { if (playBin.queryDuration().getSeconds() > 0 || playBin.queryDuration().getNanoSeconds() > 0) break; } // Wait for song to actually be playing otherwise queryDuration is always zero - callbackInterface.setSeekBarDuration((int) playBin.queryDuration().toSeconds()); + if(callbackInterface != null) + callbackInterface.setSeekBarDuration((int) playBin.queryDuration().toSeconds()); } else{ throw new StartPlayingException(inputSong.get());