[gnome-games] grilo: Replace some return_if_fail by normal tests



commit 921b1d997970bfc8eefc30bb71654367c78fa923
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Fri Sep 16 09:31:29 2016 +0200

    grilo: Replace some return_if_fail by normal tests
    
    Replace some return_if_fail tests by normal tests which can return in
    GriloCover.on_media_resolved().
    
    This avoids wrong critical errors.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771512

 src/grilo/grilo-cover.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/grilo/grilo-cover.vala b/src/grilo/grilo-cover.vala
index e6b62b5..3680acf 100644
--- a/src/grilo/grilo-cover.vala
+++ b/src/grilo/grilo-cover.vala
@@ -43,9 +43,11 @@ public class Games.GriloCover : Object, Cover {
        private void on_media_resolved () {
                var grl_media = media.get_media ();
 
-               return_if_fail (grl_media != null);
+               if (grl_media == null)
+                       return;
 
-               return_if_fail (grl_media.length (Grl.MetadataKey.THUMBNAIL) != 0);
+               if (grl_media.length (Grl.MetadataKey.THUMBNAIL) == 0)
+                       return;
 
                var uri = grl_media.get_thumbnail_nth (0);
                try_fetch_cover.begin (uri);


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