From 7c796b2d2ad7b2de6ccaf36ad0288a473dd69d4b Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 12 Nov 2009 18:17:58 -0500 Subject: [PATCH] [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 file changed, 3 insertions(+) diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 1d998efff..8ff743ecc 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);