Merge pull request #6032 from ynput/bugfix/thumbnail-representation-key-could-be-missing

Refactor code to handle missing "representations" key in instance data
This commit is contained in:
Jakub Ježek 2023-12-08 15:11:23 +01:00 committed by GitHub
commit 62a685b0e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,7 +56,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin):
# Make sure cleanup happens to representations which are having both
# tags `delete` and `need_thumbnail`
for repre in tuple(instance.data["representations"]):
for repre in tuple(instance.data.get("representations", [])):
tags = repre.get("tags") or []
# skip representations which are going to be published on farm
if "publish_on_farm" in tags: