Skip to content

Commit

Permalink
Fixed Windows file dialog crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Aug 23, 2024
1 parent e020cc5 commit aafecc8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/filedialogs/src/arc/filedialogs/FileDialogs.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void loadNatives() throws UnsatisfiedLinkError{
env->ReleaseStringChars(obj_defaultPathAndFile, defaultPathAndFile);
env->ReleaseStringChars(obj_filterDescription, filterDescription);
return env->NewString((jchar*)result, wcslen(result));
return result == NULL ? NULL : env->NewString((jchar*)result, wcslen(result));
#else
char* title = (char*)env->GetStringUTFChars(obj_title, 0);
char* defaultPathAndFile = (char*)env->GetStringUTFChars(obj_defaultPathAndFile, 0);
Expand Down Expand Up @@ -110,7 +110,7 @@ public static void loadNatives() throws UnsatisfiedLinkError{
env->ReleaseStringChars(obj_defaultPathAndFile, defaultPathAndFile);
env->ReleaseStringChars(obj_filterDescription, filterDescription);
return env->NewString((jchar*)result, wcslen(result));
return result == NULL ? NULL : env->NewString((jchar*)result, wcslen(result));
#else
char* title = (char*)env->GetStringUTFChars(obj_title, 0);
Expand Down
Binary file modified natives/natives-filedialogs/libs/arc-filedialogs.dll
Binary file not shown.
Binary file modified natives/natives-filedialogs/libs/arc-filedialogs64.dll
Binary file not shown.

0 comments on commit aafecc8

Please sign in to comment.