Skip to content

Commit 3e1b299

Browse files
committed
Fixed #115
1 parent b713662 commit 3e1b299

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

core/src/main/java/xyz/gianlu/librespot/FileConfiguration.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,11 @@ public boolean preloadEnabled() {
151151

152152
@Override
153153
public float normalisationPregain() {
154-
float result;
155154
Object raw = config.get("player.normalisationPregain");
156155

157-
if(raw instanceof Double) result = ((Double) raw).floatValue();
158-
else if(raw instanceof Integer) result = ((Integer) raw).floatValue();
156+
if (raw instanceof Double) return ((Double) raw).floatValue();
157+
else if (raw instanceof Integer) return ((Integer) raw).floatValue();
159158
else throw new IllegalArgumentException(" normalisationPregain is not a valid number: " + raw.toString());
160-
161-
return result;
162159
}
163160

164161
@NotNull

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,12 @@ public void close() {
524524

525525
@Nullable
526526
public Metadata.Track currentTrack() {
527-
return trackHandler.track();
527+
return trackHandler == null ? null : trackHandler.track();
528528
}
529529

530530
@Nullable
531531
public Metadata.Episode currentEpisode() {
532-
return trackHandler.episode();
532+
return trackHandler == null ? null : trackHandler.episode();
533533
}
534534

535535
@Nullable

0 commit comments

Comments
 (0)