From d54efe08382de35df765eb211386530a25f15e81 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 13 Aug 2014 15:13:20 -0700 Subject: [PATCH] runDialog: catch the case where no completion is available Just return null, instead of failing with an exception later trying to call substr() on null. https://bugzilla.gnome.org/show_bug.cgi?id=735062 --- js/ui/runDialog.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 1d5e7a5dc..9c9ee6706 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -182,6 +182,10 @@ const RunDialog = new Lang.Class({ let results = someResults.reduce(function(a, b) { return a.concat(b); }, []); + + if (!results.length) + return null; + let common = results.reduce(_getCommon, null); return common.substr(text.length); },