debugger beta: Fix panic that could occur when parsing an invalid dap schema (#31175)

Release Notes:

- N/A
This commit is contained in:
Anthony Eid authored and GitHub committed 2025-05-22 07:25:07 -04:00
1 parent 2b5aec45fe
commit a8b4e9de2e
4 files changed
+21 -6

No files matched your search

+4 -1
View File
@@ -201,7 +201,10 @@ impl DebugAdapter for PythonDebugAdapter {
) -> Result<StartDebuggingRequestArgumentsRequest> {
let map = config.as_object().context("Config isn't an object")?;
let request_variant = map["request"].as_str().context("request is not valid")?;
let request_variant = map
.get("request")
.and_then(|val| val.as_str())
.context("request is not valid")?;
match request_variant {
"launch" => Ok(StartDebuggingRequestArgumentsRequest::Launch),