[gnome-documents/wip/cosimoc/view-rework: 21/28] 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: 21/28] view: don't use invalid iters when activating first result
- Date: Mon, 8 Aug 2016 15:11:23 +0000 (UTC)
commit 9459a35f19f92c5738b934fbd0c69cdc18dde825
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]