mac: Guard against closed window, fixes #536.
This commit is contained in:
parent
476f545a67
commit
5086873f78
2 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ void SetupDialogForProperties(NSOpenPanel* dialog, int properties) {
|
|||
// Run modal dialog with parent window and return user's choice.
|
||||
int RunModalDialog(NSSavePanel* dialog, atom::NativeWindow* parent_window) {
|
||||
__block int chosen = NSFileHandlingPanelCancelButton;
|
||||
if (parent_window == NULL) {
|
||||
if (!parent_window || !parent_window->GetNativeWindow()) {
|
||||
chosen = [dialog runModal];
|
||||
} else {
|
||||
NSWindow* window = parent_window->GetNativeWindow();
|
||||
|
|
|
@ -99,7 +99,7 @@ int ShowMessageBox(NativeWindow* parent_window,
|
|||
|
||||
// Use runModal for synchronous alert without parent, since we don't have a
|
||||
// window to wait for.
|
||||
if (!parent_window)
|
||||
if (!parent_window || !parent_window->GetNativeWindow())
|
||||
return [[alert autorelease] runModal];
|
||||
|
||||
int ret_code = -1;
|
||||
|
|
Loading…
Reference in a new issue