[hyena] [Hyena.Gui] Prevent NRE



commit 67e7440c3d4a805650c6f454f70b85b7105ef393
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Tue Aug 10 21:15:43 2010 -0700

    [Hyena.Gui] Prevent NRE
    
    More security to prevent bgo#626335

 .../Accessibility/ListViewAccessible.cs            |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs b/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
index eac7041..0ebc6de 100644
--- a/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible.cs
@@ -157,10 +157,15 @@ namespace Hyena.Data.Gui.Accessibility
 
         private Atk.Object ActiveCell {
             get {
-                if (list_view.HeaderFocused)
+                if (list_view.HeaderFocused) {
                     return OnRefChild (list_view.ActiveColumn);
-                else
-                    return RefAt (list_view.Selection.FocusedIndex, list_view.ActiveColumn);
+                } else {
+                    if (list_view.Selection != null) {
+                        return RefAt (list_view.Selection.FocusedIndex, list_view.ActiveColumn);
+                    } else {
+                        return null;
+                    }
+                }
             }
         }
 



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