- if type(self["list"].l.getCurrentSelection()[0]) is str: # category
- if self["list"].l.getCurrentSelection()[0] in self.expanded:
- self.expanded.remove(self["list"].l.getCurrentSelection()[0])
+ sel = self["list"].l.getCurrentSelection()
+
+ if sel is None:
+ return
+
+ if type(sel[0]) is str: # category
+ if sel[0] in self.expanded:
+ self.expanded.remove(sel[0])