diff --git a/libcef/browser/javascript_dialog_win.cc b/libcef/browser/javascript_dialog_win.cc index 14f5eabbe..66a4894b9 100644 --- a/libcef/browser/javascript_dialog_win.cc +++ b/libcef/browser/javascript_dialog_win.cc @@ -61,8 +61,10 @@ INT_PTR CALLBACK CefJavaScriptDialog::DialogProc(HWND dialog, if (owner->message_type_ == content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) { size_t length = GetWindowTextLength(GetDlgItem(dialog, IDC_PROMPTEDIT)) + 1; - GetDlgItemText(dialog, IDC_PROMPTEDIT, - WriteInto(&user_input, length), length); + if (length > 1) { + GetDlgItemText(dialog, IDC_PROMPTEDIT, + WriteInto(&user_input, length), length); + } } break; case IDCANCEL: