HackStudio: Fix crash when requesting parameter list

When requesting a parameter hint message with `Ctrl + p` in a file that
doesn't have a language server, we would crash.

Now, rather than verifying that we have a language server, we return
early if we don't have one.
This commit is contained in:
Harrison Marshall 2022-02-14 23:06:11 +11:00 committed by Andreas Kling
parent d345a3689f
commit f538545987
Notes: sideshowbarker 2024-07-17 21:26:19 +09:00

View File

@ -689,7 +689,8 @@ void Editor::keydown_event(GUI::KeyEvent& event)
void Editor::handle_function_parameters_hint_request()
{
VERIFY(m_language_client);
if (!m_language_client)
return;
m_language_client->on_function_parameters_hint_result = [this](Vector<String> const& params, size_t argument_index) {
dbgln("on_function_parameters_hint_result");