fix Traceback if search icon on library panel is clicked, when no
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 22 Apr 2016 17:02:18 +0300
changeset 1501 d917c209529d
parent 1500 007588fb6549
child 1502 62eb21aab1fb
fix Traceback if search icon on library panel is clicked, when no
category/item is selected in the library.

The problem is here, that if nothing is selected method GetSelection()
returns root item, that doesn't have any python data associated with it.
This issue seems to be wx3.0 specified, because it doesn't exist
with wx2.8 on Windows.
controls/LibraryPanel.py
--- a/controls/LibraryPanel.py	Fri Apr 22 16:59:47 2016 +0300
+++ b/controls/LibraryPanel.py	Fri Apr 22 17:02:18 2016 +0300
@@ -397,7 +397,7 @@
             item_pydata = self.Tree.GetPyData(item)
             
             # Item is a block category
-            if item_pydata["type"] == CATEGORY:
+            if (item == root) or item_pydata["type"] == CATEGORY:
                 
                 # Get category first or last child according to search mode 
                 # defined