[ui] app: Check that viewpoints exist before accessing them

This commit is contained in:
Candice Bentéjac 2024-08-09 14:30:02 +02:00 committed by Aurore LAFAURIE
parent 74271019b3
commit f84d0d6341

View file

@ -246,7 +246,7 @@ class MeshroomApp(QApplication):
# find the first camerainit node
file = file["graph"]
for node in file:
if file[node]["nodeType"] == "CameraInit":
if file[node]["nodeType"] == "CameraInit" and file[node]["inputs"].get("viewpoints"):
if len(file[node]["inputs"]["viewpoints"]) > 0:
thumbnail = ThumbnailCache.createThumbnail(ThumbnailCache, file[node]["inputs"]["viewpoints"][0]["path"], -1, True)
break