Fix null pointer error in FileDialog.hx.

Co-authored-by: ShaharMS <88977041+ShaharMS@users.noreply.github.com>
This commit is contained in:
Joseph Cloutier
2022-06-01 00:15:47 -04:00
parent 02617a854d
commit afbd7e15f8

View File

@@ -164,7 +164,7 @@ class FileDialog
var path = null;
#if hl
var bytes = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath);
path = @:privateAccess String.fromUTF8(cast bytes);
if (bytes != null) path = @:privateAccess String.fromUTF8(cast bytes);
#else
path = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath);
#end
@@ -243,7 +243,7 @@ class FileDialog
var path = null;
#if hl
var bytes = NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath);
path = @:privateAccess String.fromUTF8(cast bytes);
if (bytes != null) path = @:privateAccess String.fromUTF8(cast bytes);
#else
path = NativeCFFI.lime_file_dialog_open_file(title, filter, defaultPath);
#end