[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.
This commit is contained in:
Colin Walters 2009-11-12 18:17:58 -05:00
parent 48f8e4943d
commit 7c796b2d2a

View File

@ -48,6 +48,9 @@ GnomeShell.prototype = {
let success; let success;
try { try {
returnValue = JSON.stringify(eval(code)); returnValue = JSON.stringify(eval(code));
// A hack; DBus doesn't have null/undefined
if (returnValue == undefined)
returnValue = "";
success = true; success = true;
} catch (e) { } catch (e) {
returnValue = JSON.stringify(e); returnValue = JSON.stringify(e);