Skip to content
Snippets Groups Projects
Commit 039903c6 authored by Cheng Zhao's avatar Cheng Zhao
Browse files

mac: Don't create button without title, fixes #631

parent 5df17161
No related merge requests found
......@@ -75,6 +75,9 @@ NSAlert* CreateNSAlert(NativeWindow* parent_window,
for (size_t i = 0; i < buttons.size(); ++i) {
NSString* title = base::SysUTF8ToNSString(buttons[i]);
// An empty title causes crash on OS X.
if (buttons[i].empty())
title = @"(empty)";
NSButton* button = [alert addButtonWithTitle:title];
[button setTag:i];
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment