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:
parent
c101196f5b
commit
ba23fd9989
@ -1010,7 +1010,11 @@ var LookingGlass = class LookingGlass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getResult(idx) {
|
getResult(idx) {
|
||||||
|
try {
|
||||||
return this._results[idx - this._offset].o;
|
return this._results[idx - this._offset].o;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(`Unknown result at index ${idx}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
|
Loading…
Reference in New Issue
Block a user