зеркало из https://github.com/electron/electron.git
mac: Don't create button without title, fixes #631
This commit is contained in:
Родитель
5df1716144
Коммит
039903c6b2
|
@ -75,6 +75,9 @@ NSAlert* CreateNSAlert(NativeWindow* parent_window,
|
||||||
|
|
||||||
for (size_t i = 0; i < buttons.size(); ++i) {
|
for (size_t i = 0; i < buttons.size(); ++i) {
|
||||||
NSString* title = base::SysUTF8ToNSString(buttons[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];
|
NSButton* button = [alert addButtonWithTitle:title];
|
||||||
[button setTag:i];
|
[button setTag:i];
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче