Merge pull request #415 from ynput/bugfix/AY-854_Nukestudio-crash-if-save-as-new-version-with-workfile

This commit is contained in:
Milan Kolar 2024-05-03 14:02:07 +02:00 committed by GitHub
commit aa9842cdc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,13 +51,12 @@ def open_file(filepath):
project = hiero.core.projects()[-1]
# open project file
hiero.core.openProject(filepath.replace(os.path.sep, "/"))
# close previous project
project.close()
# Close previous project if its different to the current project.
filepath = filepath.replace(os.path.sep, "/")
if project.path().replace(os.path.sep, "/") != filepath:
# open project file
hiero.core.openProject(filepath)
project.close()
return True