Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
cybre committed Jul 1, 2016
1 parent 4c83af0 commit 9874c7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions screenshot-applet/ScreenshotApplet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,12 @@ namespace ScreenshotApplet {
history_view.add_to_history(link, title_entry.text);

if (provider_to_use == "local") {
Gdk.Pixbuf pb = new Gdk.Pixbuf.from_file(link.split("://")[1]);
clipboard.set_image(pb);
try {
Gdk.Pixbuf pb = new Gdk.Pixbuf.from_file(link.split("://")[1]);
clipboard.set_image(pb);
} catch (GLib.Error e) {
stderr.printf(e.message, "\n");
}
} else {
clipboard.set_text(link, -1);
}
Expand Down

0 comments on commit 9874c7e

Please sign in to comment.