Browser: Check m_console_client is non-null before dereferencing it

This added check matches CientConnection::js_console_input and makes
sure the webcontent process doesn't crash if the console is opened
while no page is available (like in a file not found situation)
This commit is contained in:
Idan Horowitz 2021-09-30 22:28:37 +03:00 committed by Andreas Kling
parent 10d4f2fc1e
commit 890d5e45ee
Notes: sideshowbarker 2024-07-18 03:16:40 +09:00

View File

@ -317,7 +317,8 @@ void ClientConnection::run_javascript(String const& js_source)
void ClientConnection::js_console_request_messages(i32 start_index)
{
m_console_client->send_messages(start_index);
if (m_console_client)
m_console_client->send_messages(start_index);
}
Messages::WebContentServer::GetSelectedTextResponse ClientConnection::get_selected_text()