Mac app crashes when I press CANCEL in Open File dialog
hippogamesunity opened this issue · comments
Nate River commented
Hi! This only happens on Mac, and it works fine on other platforms. This doesn't happen in editor. Unfortunately, I don't know how to get any debug info from Mac apps.
Pupunzi commented
The same problem but it happens also in the editor for me...
Pupunzi commented
Maybe I solved the problem...
Pressing "Cancel" the callback is called passing an empty string as path; before doing anything in the callback just check if the "path" is not empty, otherwise return:
StandaloneFileBrowser.SaveFilePanelAsync("Save File", "", name, "i4t", (string path) => {
if(string.IsNullOrEmpty(path))
return;
StreamWriter writer = new StreamWriter(path, true);
writer.WriteLine(persisted);
writer.Close();
});
Nate River commented
I perform this check, it doesn't help.