[gnome-games] gamepad-view: Don't create handle for empty svg path



commit 8ee4585017383cac6d6c7163737f5e507ceb76d5
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Feb 25 18:24:26 2019 +0500

    gamepad-view: Don't create handle for empty svg path
    
    Avoid a runtime warning.

 src/ui/gamepad-view.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/gamepad-view.vala b/src/ui/gamepad-view.vala
index 9cba3a50..f917f785 100644
--- a/src/ui/gamepad-view.vala
+++ b/src/ui/gamepad-view.vala
@@ -11,6 +11,11 @@ private class Games.GamepadView : Gtk.DrawingArea {
                        if (value == configuration)
                                return;
 
+                       _configuration = value;
+
+                       if (value.svg_path == "")
+                               return;
+
                        try {
                                var bytes = resources_lookup_data (value.svg_path, ResourceLookupFlags.NONE);
                                var data = bytes.get_data ();
@@ -22,7 +27,6 @@ private class Games.GamepadView : Gtk.DrawingArea {
                        }
 
                        set_size_request (handle.width, handle.height);
-                       _configuration = value;
                        input_highlights = new bool[value.input_paths.length];
 
                        reset ();


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