mirror of
https://github.com/jely2002/youtube-dl-gui.git
synced 2021-11-01 22:46:21 +03:00
fix: check if window is not null before invoking method
This commit is contained in:
@@ -82,7 +82,19 @@ class QueryManager {
|
||||
totalFormats.sort((a, b) => b.height - a.height || b.fps - a.fps);
|
||||
const title = initialQuery.title == null ? url : initialQuery.title;
|
||||
const uploader = initialQuery.uploader == null ? "Unknown" : initialQuery.uploader;
|
||||
this.window.webContents.send("videoAction", {action: "setUnified", identifier: playlistVideo.identifier,formats: totalFormats, subtitles: this.environment.mainDownloadSubs, thumb: videos[0].thumbnail, title: title, length: videos.length, uploader: uploader, url: playlistVideo.url})
|
||||
if(this.window != null) {
|
||||
this.window.webContents.send("videoAction", {
|
||||
action: "setUnified",
|
||||
identifier: playlistVideo.identifier,
|
||||
formats: totalFormats,
|
||||
subtitles: this.environment.mainDownloadSubs,
|
||||
thumb: videos[0].thumbnail,
|
||||
title: title,
|
||||
length: videos.length,
|
||||
uploader: uploader,
|
||||
url: playlistVideo.url
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.removeVideo(playlistVideo);
|
||||
for (const video of videos) {
|
||||
|
||||
Reference in New Issue
Block a user