Browse Source

Convert.hx CompressIMG check for file renaming if compress failed. Will throw on converted file not found.

clementlandrin 11 months ago
parent
commit
cfe54b5539
1 changed files with 3 additions and 1 deletions
  1. 3 1
      hxd/fs/Convert.hx

+ 3 - 1
hxd/fs/Convert.hx

@@ -309,7 +309,9 @@ class CompressIMG extends Convert {
 			command("texconv", args);
 			sys.FileSystem.deleteFile(tmpFile);
 			tmpPath.ext = "tmp.DDS";
-			sys.FileSystem.rename(tmpPath.toString(), dstPath);
+			var p = tmpPath.toString();
+			if ( sys.FileSystem.exists(p) )
+				sys.FileSystem.rename(p, dstPath);
 			return;
 		}
 		var path = new haxe.io.Path(srcPath);