From 9874c7ee683cc7ebef829625ec4f90a3567f344b Mon Sep 17 00:00:00 2001 From: Stefan Ric Date: Fri, 1 Jul 2016 11:24:22 +0200 Subject: [PATCH] Catch error --- screenshot-applet/ScreenshotApplet.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/screenshot-applet/ScreenshotApplet.vala b/screenshot-applet/ScreenshotApplet.vala index de7c7d9..75668d4 100644 --- a/screenshot-applet/ScreenshotApplet.vala +++ b/screenshot-applet/ScreenshotApplet.vala @@ -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); }