[gnome-games] cover-loader: Use unsafe icon to pixbuf casts



commit d9652b90a62c22b2f371ff8dbbbe605b327c85ab
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Sun Nov 29 13:05:52 2020 +0100

    cover-loader: Use unsafe icon to pixbuf casts
    
    This, fixes two "access to possible null" compile time warning I didn't
    notice in my previous commit.

 src/core/cover-loader.vala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/core/cover-loader.vala b/src/core/cover-loader.vala
index 1f5dba41..068f3dcc 100644
--- a/src/core/cover-loader.vala
+++ b/src/core/cover-loader.vala
@@ -62,8 +62,8 @@ public class Games.CoverLoader : Object {
                        return null;
 
                try {
-                       if (icon is Gdk.Pixbuf && (icon as Gdk.Pixbuf).get_width () <= TINY_ICON_SIZE)
-                               pixbuf = (icon as Gdk.Pixbuf).scale_simple (size * scale_factor, size * 
scale_factor, Gdk.InterpType.NEAREST);
+                       if (icon is Gdk.Pixbuf && ((Gdk.Pixbuf) icon).get_width () <= TINY_ICON_SIZE)
+                               pixbuf = ((Gdk.Pixbuf) icon).scale_simple (size * scale_factor, size * 
scale_factor, Gdk.InterpType.NEAREST);
                        else
                                pixbuf = icon_info.load_icon ();
                        save_cache_to_disk (game, pixbuf, size, scale_factor, "icons");


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