diff --git a/src/pathnode_vis/pathnode_vis/pubinfo_traverse.py b/src/pathnode_vis/pathnode_vis/pubinfo_traverse.py index 48c91847af..8615b7942b 100755 --- a/src/pathnode_vis/pathnode_vis/pubinfo_traverse.py +++ b/src/pathnode_vis/pathnode_vis/pubinfo_traverse.py @@ -202,17 +202,16 @@ def solve2(self, pubinfos, tgt_topic, tgt_stamp, queue.append((tgt_topic, tgt_stamp, root_results)) while len(queue) != 0: topic, stamp, cresult = queue.popleft() - info = pubinfos.get(topic, stamp) - if info: - cresult.add_data(info) - # NDT-EKF has loop, so stop - if topic in stops: + next_pubinfo = pubinfos.get(topic, stamp) + if next_pubinfo is not None: + cresult.add_data(next_pubinfo) + else: + # print(f"pubinfo of {topic} {stamp} not found") continue - # get next edges - next_pubinfo = pubinfos.get(topic, stamp) - if not next_pubinfo: + # NDT-EKF has loop, so stop + if topic in stops: continue for in_infos in next_pubinfo.in_infos.values():