Skip to content

Commit

Permalink
--object existing check before access
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner65 committed Dec 8, 2024
1 parent 02f2fda commit 8719b7f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src_python/habitat_sim/utils/classes/object_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ def toggle_sel_obj(self, obj):
"""
Remove or add the passed object to the selected objects dict, depending on whether it is present, or not.
"""
if obj.object_id in self._sel_obj_ids:
# Remove object from obj selected dict
self._remove_obj_from_sel(obj)
else:
# Add object to selected dict
self._add_obj_to_sel(obj)
if obj is not None:
if obj.object_id in self._sel_obj_ids:
# Remove object from obj selected dict
self._remove_obj_from_sel(obj)
else:
# Add object to selected dict
self._add_obj_to_sel(obj)

def set_ao_joint_states(
self, do_open: bool, selected: bool, agent_name: str = "hab_spot"
Expand Down

0 comments on commit 8719b7f

Please sign in to comment.