From 26a49168ba2abcd60e66f64c3a3dcf8deda0c1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 19 Feb 2020 11:53:05 +0100 Subject: [PATCH] lookingGlass: Also handle null objects in objectToString Whoops, while ff4623454 fixed the handling of `undefined` objects, `null` objects obviously still don't have a toString() method. So also handle those and return 'null' in case the object is null. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1024 --- js/ui/lookingGlass.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 54e3e4858..ed0186cc2 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -244,7 +244,13 @@ function objectToString(o) { // special case this since the default is way, way too verbose return ''; } else { - return o !== undefined ? o.toString() : 'undefined'; + if (o === undefined) + return 'undefined'; + + if (o === null) + return 'null'; + + return o.toString(); } }