Skip to content

Commit 574bd9e

Browse files
committed
Merge pull request #249 from personalrobotics/bugfix/clone_none
Make `Cloned()` handle `None`.
2 parents cd27f5d + a667562 commit 574bd9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/prpy/clone.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ def Cloned(*instances, **kwargs):
186186
clone_instances = list()
187187

188188
for instance in instances:
189+
# Check if an instance is `NoneType`.
190+
# If it is, it remains NoneType in the cloned environment.
191+
if instance is None:
192+
clone_instances.append(None)
193+
continue
194+
195+
# Clone each instance based on its type.
189196
if isinstance(instance, openravepy.Robot):
190197
clone_instance = clone_env.GetRobot(instance.GetName())
191198
elif isinstance(instance, openravepy.KinBody):

0 commit comments

Comments
 (0)