File tree Expand file tree Collapse file tree
core/src/main/java/xyz/gianlu/librespot Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments