Skip to content

Commit 0a52997

Browse files
committed
fix #121 : set changes attribute of DataModel and Adapter to an empty dict by default.
Methods `new` and `open` in MappingEditor failed because Adapter.update_changes() was called before attribute changes was set (and so was equal to None).
1 parent 343aa78 commit 0a52997

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

larray_editor/arrayadapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def __init__(self, axes_model, xlabels_model, ylabels_model, data_model):
1515
self.data_model = data_model
1616

1717
# these are not valid values, but should overwritten by set_data which must be called before the adapter is used
18-
self.current_filter = None
19-
self.changes = None
18+
self.current_filter = {}
19+
self.changes = {}
2020
self.la_data = None
2121
self.bg_value = None
2222
self.filtered_data = None

larray_editor/arraymodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(self, parent=None, readonly=False, format="%.3f", font=None, minval
210210
self.minvalue = minvalue
211211
self.maxvalue = maxvalue
212212

213-
self.changes = None
213+
self.changes = {}
214214
self.color_func = None
215215

216216
self.vmin = None

0 commit comments

Comments
 (0)