Skip to content

Commit be0a658

Browse files
committed
Merge pull request #112128 from HolonProduction/lsp-init-unsafe-dict
LSP: Fix remaining unsafe dict access
2 parents 2cb2c1f + bbdf37b commit be0a658

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/gdscript/language_server/gdscript_language_protocol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
177177

178178
String root;
179179
Variant root_uri_var = p_params["rootUri"];
180-
Variant root_var = p_params["rootPath"];
180+
Variant root_var = p_params.get("rootPath", Variant());
181181
if (root_uri_var.is_string()) {
182182
root = get_workspace()->get_file_path(root_uri_var);
183183
} else if (root_var.is_string()) {
@@ -194,7 +194,7 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
194194
}
195195

196196
String root_uri = p_params["rootUri"];
197-
String root = p_params["rootPath"];
197+
String root = p_params.get("rootPath", "");
198198
bool is_same_workspace;
199199
#ifndef WINDOWS_ENABLED
200200
is_same_workspace = root.to_lower() == workspace->root.to_lower();

0 commit comments

Comments
 (0)