Skip to content

Commit

Permalink
check if thumbnail exists
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptowyrm committed Oct 26, 2018
1 parent fe53cd7 commit 5cfa382
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/DownloadRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ namespace CopyPasteGrab {
});

this.video_download.video_info.connect ((info) => {
File file = File.new_for_path (info.thumbnail);
thumbnail.set_from_file_async.begin (file, 100, 100, true);
if (info.thumbnail != null) {
File file = File.new_for_path (info.thumbnail);
thumbnail.set_from_file_async.begin (file, 100, 100, true);
}
title_label.label = info.title;
start_button.sensitive = true;
});
Expand Down
2 changes: 1 addition & 1 deletion src/VideoInfo.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace CopyPasteGrab {
public class VideoInfo : Object {
public string url { get; set; }
public string title { get; set; }
public string thumbnail { get; set; }
public string? thumbnail { get; set; }
public string json { get; set; }

public VideoInfo () {
Expand Down

0 comments on commit 5cfa382

Please sign in to comment.