]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectrl.cpp
Implemented flat toolbars
[wxWidgets.git] / src / generic / treectrl.cpp
index c69ea64098cf5f01e8e7f6542e1ed336c39c47f4..2494432374c41d31535d8e251e73a9bd6caeaab6 100644 (file)
@@ -1327,14 +1327,17 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event )
                 if (!prev)
                 {
                     prev = GetParent( m_current );
-                    long cockie = 0;
-                    wxTreeItemId current = m_current;
-                    if (current == GetFirstChild( prev, cockie ))
-                    {
-                        // otherwise we return to where we came from
-                        SelectItem( prev );
-                        EnsureVisible( prev );
-                        break;
+                   if (prev)
+                   {
+                        long cockie = 0;
+                        wxTreeItemId current = m_current;
+                        if (current == GetFirstChild( prev, cockie ))
+                        {
+                            // otherwise we return to where we came from
+                            SelectItem( prev );
+                            EnsureVisible( prev );
+                            break;
+                       }
                     }
                 }
                 if (prev)