From d046cf893c1869cd529025808f4c089f6b7dfa94 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 15 Sep 2018 15:47:48 -0300 Subject: Don't crash when passing playlists This happened when the openPlaylistDialog was closed before being opened - Dialog.close would try to select(this.oldSelectedElement), but of course that would be undefined since the dialog had never been opened in the first place. --- ui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ui.js') diff --git a/ui.js b/ui.js index 755d95f..aaa877a 100644 --- a/ui.js +++ b/ui.js @@ -231,7 +231,10 @@ class AppElement extends FocusElement { } async handlePlaylistSource(source, newTab = false) { - this.openPlaylistDialog.close() + if (this.openPlaylistDialog.visible) { + this.openPlaylistDialog.close() + } + this.alertDialog.showMessage('Opening playlist...', false) let grouplike -- cgit 1.3.0-6-gf8a5