Merge pull request #1249 from Aaron1011/empty_accordian_crash

Stopped empty accordian from accessing its first child when initialized
This commit is contained in:
Gabriel Pettier 2013-06-05 16:01:41 -07:00
commit a8828f4e03
1 changed files with 4 additions and 1 deletions

View File

@ -386,7 +386,10 @@ class Accordion(Widget):
def _do_layout(self, dt):
children = self.children
all_collapsed = all(x.collapse for x in children)
if children:
all_collapsed = all(x.collapse for x in children)
else:
all_collapsed = False
if all_collapsed:
children[0].collapse = False