[gnome-shell/gnome-3-24] history: Fix bogus return value
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-24] history: Fix bogus return value
- Date: Thu, 13 Jul 2017 15:36:16 +0000 (UTC)
commit 114f3717531e341d64659e026dbb30cb6879053f
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Jun 13 04:56:34 2017 +0200
history: Fix bogus return value
We only use lastItem() to reset the history index to the end, so
nobody noticed the utter nonsense in the return value until gjs
started to warn about it. As we don't actually use the value
anywhere, we could just remove it, but the function name implies
that an item is returned, so fix it to behave as advertised.
https://bugzilla.gnome.org/show_bug.cgi?id=781471
js/misc/history.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/misc/history.js b/js/misc/history.js
index b56d830..44d21b7 100644
--- a/js/misc/history.js
+++ b/js/misc/history.js
@@ -69,7 +69,7 @@ const HistoryManager = new Lang.Class({
this._indexChanged();
}
- return this._historyIndex[this._history.length];
+ return this._historyIndex ? this._history[this._historyIndex -1] : null;
},
addItem: function(input) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]