[gnome-documents] view: don't try to get a GtkTreeIter for NULL paths



commit 8863b8021ec34298315b19377f8ddbcff2bfc679
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Sep 9 13:44:35 2011 -0400

    view: don't try to get a GtkTreeIter for NULL paths
    
    getPathAtPos() can return NULL if the click is in an empty area, so
    don't try to popup the context menu item in that case.

 src/view.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/view.js b/src/view.js
index 7183c53..32afe66 100644
--- a/src/view.js
+++ b/src/view.js
@@ -146,6 +146,10 @@ View.prototype = {
             return false;
 
         let path = this.getPathAtPos(coords);
+
+        if (!path)
+            return false;
+
         let iter = this._treeModel.get_iter(path)[1];
 
         let urn = this._treeModel.get_value(iter, Documents.ModelColumns.URN);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]