fix case where staging dir is not set

This commit is contained in:
Ondrej Samohel 2020-08-07 13:45:32 +02:00
parent 0b25a6ff46
commit 23caec0a76
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7

View file

@ -71,12 +71,16 @@ class CleanUp(pyblish.api.InstancePlugin):
temp_root = tempfile.gettempdir()
staging_dir = instance.data.get("stagingDir", None)
if not staging_dir:
self.log.info("Staging dir not set.")
return
if not os.path.normpath(staging_dir).startswith(temp_root):
self.log.info("Skipping cleanup. Staging directory is not in the "
"temp folder: %s" % staging_dir)
return
if not staging_dir or not os.path.exists(staging_dir):
if not os.path.exists(staging_dir):
self.log.info("No staging directory found: %s" % staging_dir)
return