fix "local variable 'txt' referenced before assignment"
This commit is contained in:
parent
cc98ef3763
commit
c5df294a28
@ -96,10 +96,14 @@ class DataModel(QAbstractTableModel):
|
|||||||
return
|
return
|
||||||
elif role == Qt.DisplayRole and section < len(self.activeCols):
|
elif role == Qt.DisplayRole and section < len(self.activeCols):
|
||||||
type = self.columnType(section)
|
type = self.columnType(section)
|
||||||
|
txt = None
|
||||||
for stype, name in self.browser.columns:
|
for stype, name in self.browser.columns:
|
||||||
if type == stype:
|
if type == stype:
|
||||||
txt = name
|
txt = name
|
||||||
break
|
break
|
||||||
|
# handle case where extension has set an invalid column type
|
||||||
|
if not txt:
|
||||||
|
txt = self.browser.columns[0][1]
|
||||||
return txt
|
return txt
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user