Skip to content

Commit 1ad4766

Browse files
committed
fix possible conversion error
1 parent 67a7417 commit 1ad4766

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

unilabos/ros/nodes/base_device_node.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,10 +1971,15 @@ def _convert_resources_sync(self, *uuids: str) -> List["ResourcePLR"]:
19711971

19721972
mapped_plr_resources = []
19731973
for uuid in uuids_list:
1974+
found = None
19741975
for plr_resource in figured_resources:
19751976
r = self.resource_tracker.loop_find_with_uuid(plr_resource, uuid)
1976-
mapped_plr_resources.append(r)
1977-
break
1977+
if r is not None:
1978+
found = r
1979+
break
1980+
if found is None:
1981+
raise Exception(f"未能在已解析的资源树中找到 uuid={uuid} 对应的资源")
1982+
mapped_plr_resources.append(found)
19781983

19791984
return mapped_plr_resources
19801985

0 commit comments

Comments
 (0)