From f53854598752745553c9185740330ea447d4b7c3 Mon Sep 17 00:00:00 2001 From: Harrison Marshall Date: Mon, 14 Feb 2022 23:06:11 +1100 Subject: 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. --- Userland/DevTools/HackStudio/Editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Userland/DevTools/HackStudio/Editor.cpp') diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index f0472977e3..724f3c3554 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -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 const& params, size_t argument_index) { dbgln("on_function_parameters_hint_result"); -- cgit v1.2.3