[gnome-shell/gnome-3-24] shellDBus: Avoid access to undefined properties



commit 7db7b7dcbd2ef8b8a593e7aa0a70e496e3337611
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jun 17 18:31:34 2017 +0200

    shellDBus: Avoid access to undefined properties
    
    Don't rely on an implicit undefined value of unset parameters to
    shut up some warnings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781471

 js/ui/shellDBus.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index 14dba72..7cde2e6 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -142,15 +142,15 @@ const GnomeShell = new Lang.Class({
         for (let param in params)
             params[param] = params[param].deep_unpack();
 
-        let monitorIndex = -1;
-        if (params['monitor'] >= 0)
-            monitorIndex = params['monitor'];
+        let monitorIndex = params['monitor'] || -1;
+        let label = params['label'] || undefined;
+        let level = params['level'] || undefined;
 
         let icon = null;
         if (params['icon'])
             icon = Gio.Icon.new_for_string(params['icon']);
 
-        Main.osdWindowManager.show(monitorIndex, icon, params['label'], params['level']);
+        Main.osdWindowManager.show(monitorIndex, icon, label, level);
     },
 
     FocusApp: function(id) {


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