Null fixes

This commit is contained in:
Joshua Granick
2015-08-22 22:10:41 -07:00
parent 90f65c4c5d
commit aa6a17b1cf
2 changed files with 7 additions and 6 deletions

View File

@@ -231,11 +231,12 @@ namespace lime {
value lime_file_dialog_save_file (value filter, value defaultPath) { value lime_file_dialog_save_file (value filter, value defaultPath) {
#ifdef LIME_NFD #ifdef LIME_NFD
return alloc_string (FileDialog::SaveFile (val_string (filter), val_string (defaultPath))); const char* path = FileDialog::SaveFile (val_string (filter), val_string (defaultPath));
#else if (path) return alloc_string (path);
return alloc_null ();
#endif #endif
return alloc_null ();
} }

View File

@@ -8,7 +8,7 @@ namespace lime {
const char* FileDialog::OpenFile (const char* filter, const char* defaultPath) { const char* FileDialog::OpenFile (const char* filter, const char* defaultPath) {
nfdchar_t *savePath = NULL; nfdchar_t *savePath = 0;
nfdresult_t result = NFD_OpenDialog (filter, defaultPath, &savePath); nfdresult_t result = NFD_OpenDialog (filter, defaultPath, &savePath);
switch (result) { switch (result) {
@@ -49,7 +49,7 @@ namespace lime {
} }
//NFD_PathSet_Free (&pathSet); NFD_PathSet_Free (&pathSet);
break; break;
} }
@@ -69,7 +69,7 @@ namespace lime {
const char* FileDialog::SaveFile (const char* filter, const char* defaultPath) { const char* FileDialog::SaveFile (const char* filter, const char* defaultPath) {
nfdchar_t *savePath = NULL; nfdchar_t *savePath = 0;
nfdresult_t result = NFD_SaveDialog (filter, defaultPath, &savePath); nfdresult_t result = NFD_SaveDialog (filter, defaultPath, &savePath);
switch (result) { switch (result) {