diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index c957a1403..14b8cfdff 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -421,7 +421,7 @@ namespace CefSharp } bool result; - bool handled; + bool handled = false; switch (dialog_type) { @@ -436,14 +436,13 @@ namespace CefSharp case JSDIALOGTYPE_PROMPT: String^ resultString = nullptr; - result = handler->OnJSPrompt(_browserControl, StringUtils::ToClr(origin_url), StringUtils::ToClr(message_text), + handled = handler->OnJSPrompt(_browserControl, StringUtils::ToClr(origin_url), StringUtils::ToClr(message_text), StringUtils::ToClr(default_prompt_text), result, resultString); callback->Continue(result, StringUtils::ToNative(resultString)); break; } - // Unknown dialog type, so we return "not handled". - return false; + return handled; } bool ClientAdapter::OnFileDialog(CefRefPtr browser, FileDialogMode mode, const CefString& title,