[smuxi/stable] Frontend-GNOME: fixed NRE thrown in ChatTreeView.IsVisible() (closes: #919)



commit 77c95de99d77c327fde57c0efdd6d56f019952a4
Author: Mirco Bauer <meebey meebey net>
Date:   Sun Dec 22 01:31:19 2013 +0100

    Frontend-GNOME: fixed NRE thrown in ChatTreeView.IsVisible() (closes: #919)
    
    Seems like TreeView.GetVisibleRange() returns false and doesn't set the out
    parameters when the treeview is not visible/realized. This happened on
    Ubuntu/Quantal where the treeview is not expanding to its preferred size for
    some reason.

 src/Frontend-GNOME/Views/ChatTreeView.cs |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/Frontend-GNOME/Views/ChatTreeView.cs b/src/Frontend-GNOME/Views/ChatTreeView.cs
index fc9c558..07b390c 100644
--- a/src/Frontend-GNOME/Views/ChatTreeView.cs
+++ b/src/Frontend-GNOME/Views/ChatTreeView.cs
@@ -172,7 +172,9 @@ namespace Smuxi.Frontend.Gnome
             }
 
             Gtk.TreePath visibleStart, visibleEnd;
-            GetVisibleRange(out visibleStart, out visibleEnd);
+            if (!GetVisibleRange(out visibleStart, out visibleEnd)) {
+                return false;
+            }
             var chatIter = FindChatIter(chatView);
             var chatPath = TreeStore.GetPath(chatIter);
             // we ignore 0 on purpose, say if a few pixels of a row are returned


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