[gnome-shell] [shellDBus] Avoid sending undefined over DBus



commit 7c796b2d2ad7b2de6ccaf36ad0288a473dd69d4b
Author: Colin Walters <walters verbum org>
Date:   Thu Nov 12 18:17:58 2009 -0500

    [shellDBus] Avoid sending undefined over DBus
    
    DBus doesn't have a notion of null/undefined, so do the lame
    thing and return the empty string.

 js/ui/shellDBus.js |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index 1d998ef..8ff743e 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -48,6 +48,9 @@ GnomeShell.prototype = {
         let success;
         try {
             returnValue = JSON.stringify(eval(code));
+            // A hack; DBus doesn't have null/undefined
+            if (returnValue == undefined)
+                returnValue = "";
             success = true;
         } catch (e) {
             returnValue = JSON.stringify(e);



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