Skip to content

Commit c50f314

Browse files
committed
Fixed NPE when checking #isActive() (#230)
1 parent e6d6776 commit c50f314

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • core/src/main/java/xyz/gianlu/librespot/player

core/src/main/java/xyz/gianlu/librespot/player/Player.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ public void playbackResumedFromHalt(int chunk, long diff) {
618618
* @return Whether the player is active
619619
*/
620620
public boolean isActive() {
621-
return state.isActive();
621+
return state != null && state.isActive();
622622
}
623623

624624
/**
@@ -739,6 +739,11 @@ public long time() {
739739
}
740740
}
741741

742+
743+
// ================================ //
744+
// ============ Close! ============ //
745+
// ================================ //
746+
742747
@Override
743748
public void close() {
744749
if (playerSession != null) {
@@ -756,11 +761,6 @@ public void close() {
756761
events.close();
757762
}
758763

759-
760-
// ================================ //
761-
// ============ Close! ============ //
762-
// ================================ //
763-
764764
public interface Configuration {
765765
@NotNull
766766
AudioQuality preferredQuality();

0 commit comments

Comments
 (0)