[gnome-shell] runDialog: catch the case where no completion is available
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] runDialog: catch the case where no completion is available
- Date: Tue, 19 Aug 2014 16:43:08 +0000 (UTC)
commit d54efe08382de35df765eb211386530a25f15e81
Author: Cosimo Cecchi <cosimo endlessm com>
Date: Wed Aug 13 15:13:20 2014 -0700
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 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index 1d5e7a5..9c9ee67 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);
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]