dabo Commit
Revision 4344
Date: 2008-08-03 08:46:14 -0700 (Sun, 03 Aug 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4344
Changed:
U trunk/dabo/ui/uiwx/dTreeView.py
Log:
Fixed a potential problem that can throw an error if the Selection property is
accessed before any nodes are added to the tree.
Diff:
Modified: trunk/dabo/ui/uiwx/dTreeView.py
===================================================================
--- trunk/dabo/ui/uiwx/dTreeView.py 2008-08-03 15:45:02 UTC (rev 4343)
+++ trunk/dabo/ui/uiwx/dTreeView.py 2008-08-03 15:46:14 UTC (rev 4344)
@@ -1123,8 +1123,11 @@
else:
itemID = self.GetSelection()
if itemID:
- ret = [ n for n in self.nodes
- if n.itemID == itemID][0]
+ try:
+ ret = [n for n in self.nodes
+ if n.itemID ==
itemID][0]
+ except IndexError:
+ ret = None
else:
ret = None
return ret
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]