Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.4, 2.0.5, and 2.1

stable filelistview: validate index before dereferencing (fixes #547)

Changeset db65b8bbb768

Parent 251abb0d0ed6

by Steve Borho

Changes to one file · Browse files at db65b8bbb768 Showing diff from parent 251abb0d0ed6 Diff from another changeset...

 
227
228
229
230
 
 
 
 
231
232
233
 
281
282
283
284
 
 
 
 
285
286
287
 
227
228
229
 
230
231
232
233
234
235
236
 
284
285
286
 
287
288
289
290
291
292
293
@@ -227,7 +227,10 @@
  _("The selected subrepository does not exist on the working directory"))     def doubleClickHandler(self): - itemissubrepo = (self.model().dataFromIndex(self.currentIndex())['status'] == 'S') + index = self.currentIndex() + if not index.isValid(): + return + itemissubrepo = (self.model().dataFromIndex(index)['status'] == 'S')   if itemissubrepo:   self.opensubrepo()   else: @@ -281,7 +284,10 @@
  self.addAction(act)     def contextMenuEvent(self, event): - itemissubrepo = (self.model().dataFromIndex(self.currentIndex())['status'] == 'S') + index = self.currentIndex() + if not index.isValid(): + return + itemissubrepo = (self.model().dataFromIndex(index)['status'] == 'S')     # Subrepos and regular items have different context menus   if itemissubrepo: