diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2014-01-28 22:29:27 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2014-01-28 22:29:27 +0400 |
commit | ee9b08feeeda0d4c364fb4fa47dc27ac18a89fa2 (patch) | |
tree | a403f7fd738be7390749fa0f08bdb97a111ae93d /Xwt.Gtk | |
parent | c0889d4981ffc8ee7ee0b35732055739a6d83060 (diff) |
[GTK] Don't crash if a stock icon can't be rendered
Diffstat (limited to 'Xwt.Gtk')
-rw-r--r-- | Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs b/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs index 2dc9ba4f..ff590cf6 100644 --- a/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs +++ b/Xwt.Gtk/Xwt.GtkBackend/ImageHandler.cs @@ -187,6 +187,9 @@ namespace Xwt.GtkBackend if (result == null && Gtk.IconTheme.Default.HasIcon (stockId)) result = Gtk.IconTheme.Default.LoadIcon (stockId, (int)width, (Gtk.IconLookupFlags)0); + if (result == null) { + return CreateBitmap (Gtk.Stock.MissingImage, width, height, scaleFactor); + } return result; } } |