Skip to content

Commit

Permalink
Changed order of appending to allow failure first.
Browse files Browse the repository at this point in the history
  • Loading branch information
MicahGale committed Sep 10, 2024
1 parent d14d96d commit 8b50e68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion montepy/numbered_object_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ def append(self, obj, insert_in_data=True):
:type insert_in_data: bool
:raises NumberConflictError: if this object has a number that is already in use.
"""
super().append(obj)
if self._problem:
if self._last_index:
index = self._last_index
Expand All @@ -452,7 +453,6 @@ def append(self, obj, insert_in_data=True):
if insert_in_data:
self._problem.data_inputs.insert(index + 1, obj)
self._last_index = index + 1
super().append(obj)

def __delitem__(self, idx):
if not isinstance(idx, int):
Expand Down

0 comments on commit 8b50e68

Please sign in to comment.