From c5df294a287f296f55c0cf646433b1c4e7dd2a33 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 13 Jan 2014 19:07:34 +0900 Subject: [PATCH] fix "local variable 'txt' referenced before assignment" --- aqt/browser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aqt/browser.py b/aqt/browser.py index 23025aa65..5bbd33ece 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -96,10 +96,14 @@ class DataModel(QAbstractTableModel): return elif role == Qt.DisplayRole and section < len(self.activeCols): type = self.columnType(section) + txt = None for stype, name in self.browser.columns: if type == stype: txt = name break + # handle case where extension has set an invalid column type + if not txt: + txt = self.browser.columns[0][1] return txt else: return