From d5bac69ff7dd0e6b0acfa59216827f2a77ca9587 Mon Sep 17 00:00:00 2001 From: Shahar Marcus <88977041+ShaharMS@users.noreply.github.com> Date: Tue, 30 Aug 2022 10:08:45 +0300 Subject: [PATCH] Update FileDialog.hx FileDialog.browse fixed for OPEN_FILE, OPEN_DIRECTORY. I changed formatting of the null check on SAVE to match the formatting in the file. --- src/lime/ui/FileDialog.hx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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