diff --git a/js/misc/history.js b/js/misc/history.js index b56d83064..44d21b7d6 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) {