Skip to content

Commit

Permalink
Bugfix: If spotify is not enabled, an Exception is thrown on its page
Browse files Browse the repository at this point in the history
  • Loading branch information
VVEIRD committed Dec 27, 2018
1 parent 73d4252 commit 70e5d6f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public JSpotifySoundPage() {

private void updateList() {
pnContent.removeAll();
List<Sound> sbs = AudioApp.getSpotifyPlaylistSounds(Type.AMBIENCE).stream()
.filter(s -> filter.length() == 0 || s.getName().toLowerCase().contains(filter.toLowerCase())).collect(Collectors.toList());
List<Sound> sbs = AudioApp.getSpotifyPlaylistSounds(Type.AMBIENCE);
if(sbs == null)
sbs = new LinkedList<>();
sbs.stream().filter(s -> filter.length() == 0 || s.getName().toLowerCase().contains(filter.toLowerCase())).collect(Collectors.toList());
List<JPanel> toAdd = new ArrayList<>(sbs.size());
for (Sound sound : sbs) {
JSoundPanel jsbp = new JSoundPanel(sound, ColorScheme.MAIN_BACKGROUND_COLOR);
Expand Down

0 comments on commit 70e5d6f

Please sign in to comment.