Skip to content

Commit cabb4ae

Browse files
committed
oweditdomain: Initialize var attribute
Fix an AttributeError due to an uninitialized attribute
1 parent 8975c02 commit cabb4ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Orange/widgets/data/oweditdomain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class VariableEditor(QWidget):
122122

123123
def __init__(self, parent=None):
124124
QWidget.__init__(self, parent)
125+
self.var = None
125126
self.setup_gui()
126127

127128
def setup_gui(self):
@@ -231,7 +232,8 @@ def is_same(self):
231232
name = str(self.name_edit.text())
232233
labels = self.labels_model.get_dict()
233234

234-
return self.var and name == self.var.name and labels == self.var.attributes
235+
return (self.var is not None and name == self.var.name and
236+
labels == self.var.attributes)
235237

236238
def clear(self):
237239
"""Clear the editor state.

0 commit comments

Comments
 (0)