Fix a NullPointerException when people specify a path in the same directory without a parent. (#6)

* Update OptimizedOBJConverter.java

* Update OBJConverter.java
This commit is contained in:
cire3 2024-07-15 00:05:29 -05:00 committed by GitHub
parent 9e0f5a5f3d
commit d9fcea6190
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -50,6 +50,7 @@ public class OBJConverter {
System.out.println("Exporting " + (v1_8 ? "1.8" : "1.5") + " MDL: " + output.getAbsolutePath());
boolean tex = args[2].equalsIgnoreCase("true") || args[2].equals("1");
if (!output.exists()) {
if (output.getParentFile() != null)
if (!output.getParentFile().exists())
if (!output.getParentFile().mkdirs())
throw new RuntimeException("Failed to create parent dir!");

View File

@ -25,6 +25,7 @@ public class OptimizedOBJConverter {
System.out.println("Exporting " + (v1_8 ? "1.8" : "1.5") + " MDL: " + output.getAbsolutePath());
boolean tex = args[2].equalsIgnoreCase("true") || args[2].equals("1");
if (!output.exists()) {
if (output.getParentFile() != null)
if (!output.getParentFile().exists())
if (!output.getParentFile().mkdirs())
throw new RuntimeException("Failed to create parent dir!");