[ui] Check for the existence of the poses key before accessing it

When parsing the input JSON file, there might be some instances where
the `poses` key, unlike the `views` and `intrinsics` keys, does not exist.
If that is the case, an unhandled exception is raised while connections
are being made, which then causes issues for the lifetime of the Meshroom
instance.

This commit checks that the key exists before trying to access it, which
prevents raising unhandled exceptions while the active project is being
set up.
This commit is contained in:
Candice Bentéjac 2023-09-15 17:12:39 +02:00
parent 05080b2ba9
commit 7fc52f2028

View file

@ -373,8 +373,9 @@ def parseSfMJsonFile(sfmJsonFile):
for view in report['views']:
views[view['viewId']] = view
for pose in report['poses']:
poses[pose['poseId']] = pose['pose']
if "poses" in report:
for pose in report['poses']:
poses[pose['poseId']] = pose['pose']
for intrinsic in report['intrinsics']:
intrinsics[intrinsic['intrinsicId']] = intrinsic