debugger: Don't take JS adapter's suggested child session name if it's empty (#33739)

Related to #33072 

We use the JS adapter's suggested names for child sessions, but
sometimes it sends us `""`, so don't use that one.

Release Notes:

- debugger: Fixed nameless child sessions appearing with the JavaScript
adapter.
This commit is contained in:
Cole Miller 2025-07-01 17:09:19 -04:00 committed by GitHub
parent 1d74fdc59f
commit 9d6b2e8a32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -522,7 +522,11 @@ impl DebugAdapter for JsDebugAdapter {
}
fn label_for_child_session(&self, args: &StartDebuggingRequestArguments) -> Option<String> {
let label = args.configuration.get("name")?.as_str()?;
let label = args
.configuration
.get("name")?
.as_str()
.filter(|name| !name.is_empty())?;
Some(label.to_owned())
}
}