Skip to content

Commit 29e4b31

Browse files
authored
Merge pull request #1831 from HEXRD/mat-name-avoid-none
Don't set material name to `None` by accident
2 parents e04f417 + 7747f05 commit 29e4b31

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hexrdgui/absorption_correction_options_dialog.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,14 @@ def material_changed(self, category, index=0, text=None):
149149
self.density_inputs[category].setValue(0.0)
150150
if category == 'filter':
151151
det_name = self.ui.detectors.currentText()
152-
self.filters[det_name]['material'] = material.name if index > 0 else text
152+
153+
mat_name = text
154+
if index > 0:
155+
mat_name = material.name
156+
157+
if mat_name is not None:
158+
# If the mat name is None, then we aren't updating it
159+
self.filters[det_name]['material'] = mat_name
153160

154161
def filter_info_changed(self, new_value=None, det_name=None):
155162
if det_name is None:

0 commit comments

Comments
 (0)