Commits

Steve Borho committed 1ccd751

filelistview: validate model data before dereference (fixes #653)

Comments (0)

Files changed (1)

tortoisehg/hgqt/filelistview.py

         index = self.currentIndex()
         if not index.isValid():
             return
-        itemissubrepo = (self.model().dataFromIndex(index)['status'] == 'S')
+        data = self.model().dataFromIndex(index)
+        if data is None:
+            return
+        itemissubrepo = (data['status'] == 'S')
 
         # Subrepos and regular items have different context menus
         if itemissubrepo: