Skip to content

Commit fe5f1c6

Browse files
fix: small defense against elements that might have no pose in history
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 1f4c2d1 commit fe5f1c6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/gh/diffCheck/diffCheck/df_error_estimation.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ def add_history(self, pose_history : dict[str, DFPosesBeam]):
285285
"""
286286
self.pose_history = pose_history
287287
for element in pose_history:
288-
self.last_poses[element] = pose_history[element].poses_dictionary[list(pose_history[element].poses_dictionary.keys())[-1]]
288+
poses_dict = pose_history[element].poses_dictionary
289+
self.last_poses[element] = poses_dict[next(reversed(poses_dict))] if poses_dict else None
289290

290291
def add_last_poses(self, last_poses : dict[str, DFPose]):
291292
"""

0 commit comments

Comments
 (0)