diff --git a/src/lime/ui/FileDialog.hx b/src/lime/ui/FileDialog.hx index 559cc912c..d1ac15372 100644 --- a/src/lime/ui/FileDialog.hx +++ b/src/lime/ui/FileDialog.hx @@ -112,7 +112,10 @@ 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 @@ -149,7 +152,10 @@ class FileDialog var path = null; #if hl var bytes = NativeCFFI.lime_file_dialog_open_directory(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_directory(title, filter, defaultPath); #end @@ -164,7 +170,10 @@ class FileDialog var path = null; #if hl var bytes = NativeCFFI.lime_file_dialog_save_file(title, filter, defaultPath); - if (bytes != null) 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