From b667e4ff7e4735367139700143d607bccbd8977a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Br=C3=BCschweiler?= <blei42@gmail.com>
Date: Wed, 16 Nov 2011 12:39:05 +0100
Subject: [PATCH] ui.backend.gtk: don't die if the icon doesn't exist,
 partially fixes #369

---
 basis/ui/backend/gtk/gtk.factor | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/basis/ui/backend/gtk/gtk.factor b/basis/ui/backend/gtk/gtk.factor
index 3bba14b7b4..033a96a786 100644
--- a/basis/ui/backend/gtk/gtk.factor
+++ b/basis/ui/backend/gtk/gtk.factor
@@ -223,14 +223,18 @@ CONSTANT: action-key-codes
 
 ! This word gets replaced when deploying. See 'Vocabulary icons'
 ! in the docs and tools.deploy.shaker.gtk-icon
-: get-icon-data ( -- byte-array )
-    "resource:misc/icons/Factor_48x48.png" binary file-contents ;
+: get-icon-data ( -- byte-array/f )
+    [
+        "resource:misc/icons/Factor_48x48.png" binary file-contents
+    ] [ drop f ] recover ;
 
 : load-icon ( -- )
     get-icon-data [
-        data>GInputStream &g_object_unref
-        GInputStream>GdkPixbuf gtk_window_set_default_icon
-    ] with-destructors ;
+        [
+            data>GInputStream &g_object_unref
+            GInputStream>GdkPixbuf gtk_window_set_default_icon
+        ] with-destructors
+    ] when* ;
 
 :: connect-user-input-signals ( win -- )
     win events-mask gtk_widget_add_events