[gnome-games] ui: Check icon_info for null in GameThumbnail



commit f2447c0fc46bdc7e382973bc50dec4d3b4e2da91
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Aug 14 16:30:24 2018 +0500

    ui: Check icon_info for null in GameThumbnail
    
    Prevents runtime warning in gtk_icon_info_load_icon().

 src/ui/game-thumbnail.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/ui/game-thumbnail.vala b/src/ui/game-thumbnail.vala
index 2489004b..ac6ae81f 100644
--- a/src/ui/game-thumbnail.vala
+++ b/src/ui/game-thumbnail.vala
@@ -173,6 +173,9 @@ private class Games.GameThumbnail: Gtk.DrawingArea {
                var size = int.min (context.width, context.height) * scale;
                var icon_info = theme.lookup_by_gicon (icon, (int) size, lookup_flags);
 
+               if (icon_info == null)
+                       return null;
+
                try {
                        return icon_info.load_icon ();
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]