[gnome-documents/wip/cosimoc/view-rework: 33/42] view: don't use invalid iters when activating first result
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/cosimoc/view-rework: 33/42] view: don't use invalid iters when activating first result
- Date: Sat, 3 Sep 2016 17:01:57 +0000 (UTC)
commit eba31984a4234044db5653cc60391c25c6cbf156
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Aug 7 14:58:35 2016 -0700
view: don't use invalid iters when activating first result
src/view.js | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/view.js b/src/view.js
index 647201b..c359bd4 100644
--- a/src/view.js
+++ b/src/view.js
@@ -459,8 +459,8 @@ const ViewContainer = new Lang.Class({
_getFirstDocument: function() {
let doc = null;
- let iter = this._model.get_iter_first()[1];
- if (iter) {
+ let [success, iter] = this._model.get_iter_first();
+ if (success) {
let id = this._model.get_value(iter, Gd.MainColumns.ID);
doc = Application.documentManager.getItemById(id);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]