Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
Fixed problem that made the program freeze if you tried to refresh pl…
Browse files Browse the repository at this point in the history
…aylists without having any playlists already.
  • Loading branch information
Stekeblad committed Feb 28, 2018
1 parent a3d7845 commit 9ea3429
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public void onWindowClose(WindowEvent windowEvent) {
Optional<ButtonType> buttonChoice = AlertUtils.yesNo("Unsaved changes", "One or more presets " +
"is in edit mode, if you close this window now all unsaved changes to presets will be lost. " +
"Do you want to close this window?").showAndWait();
System.out.println(buttonChoice);
if(buttonChoice.isPresent()) {
if(buttonChoice.get() == ButtonType.NO) {
windowEvent.consume(); // do not close the window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ public void refreshPlaylist() {
List<Playlist> playlists = response.getItems();
for (Playlist aPlaylist : playlists) {
String title = aPlaylist.getSnippet().getTitle();
LocalPlaylist oldPlaylist = oldCache.get(title);
LocalPlaylist newPlaylist;
if (oldPlaylist != null) {
if (oldCache != null && oldCache.get(title) != null) {
newPlaylist = new LocalPlaylist(oldCache.get(title).isVisible(), aPlaylist.getId(), title);
} else {
newPlaylist = new LocalPlaylist(true, aPlaylist.getId(), title);
Expand Down

0 comments on commit 9ea3429

Please sign in to comment.