[gnome-games] cover-loader: Use unsafe icon to pixbuf casts
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] cover-loader: Use unsafe icon to pixbuf casts
- Date: Fri, 4 Dec 2020 23:12:51 +0000 (UTC)
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]