lookingGlass: Throw a clearer error on referencing invalid result index

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/700
This commit is contained in:
Marco Trevisan (Treviño) 2019-05-20 23:27:48 +02:00 committed by Florian Müllner
parent c101196f5b
commit ba23fd9989

View File

@ -1010,7 +1010,11 @@ var LookingGlass = class LookingGlass {
}
getResult(idx) {
try {
return this._results[idx - this._offset].o;
} catch (e) {
throw new Error(`Unknown result at index ${idx}`);
}
}
toggle() {