diff --git a/src/aiida/orm/nodes/data/array/xy.py b/src/aiida/orm/nodes/data/array/xy.py index 5171b1bc05..ed8ab64635 100644 --- a/src/aiida/orm/nodes/data/array/xy.py +++ b/src/aiida/orm/nodes/data/array/xy.py @@ -187,6 +187,8 @@ def get_y_arraynames(self) -> list[str]: """Returns the user-provided names of the y-arrays.""" try: - return self.base.attributes.get('y_names') + y_names = self.base.attributes.get('y_names') + if y_names is None: + raise KeyError except (KeyError, AttributeError): - raise NotExistent(f'No y names been set yet') \ No newline at end of file + raise NotExistent(f'No y names been set yet!') \ No newline at end of file