1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fix crash when importing brushes and palettes

This commit is contained in:
Emmanouil Papadeas 2024-08-12 02:34:51 +03:00
parent 0d60c4195e
commit c4beee6f41

View file

@ -489,8 +489,7 @@ func file_name_replace(file_name: String, folder: String) -> String:
var i := 1 var i := 1
var file_ext := file_name.get_extension() var file_ext := file_name.get_extension()
var temp_name := file_name var temp_name := file_name
var dir := DirAccess.open(Global.home_data_directory.path_join(folder)) while FileAccess.file_exists(Global.home_data_directory.path_join(folder).path_join(temp_name)):
while dir.file_exists(temp_name):
i += 1 i += 1
temp_name = file_name.get_basename() + " (%s)" % i temp_name = file_name.get_basename() + " (%s)" % i
temp_name += "." + file_ext temp_name += "." + file_ext