debugger beta: Fix inline value provider panic (#32502)

Closes #32143

Release Notes:

- debugger beta: Fix panic that could occur when generating inline
values
This commit is contained in:
Anthony Eid 2025-06-10 21:01:30 -04:00 committed by GitHub
parent 5eb68f0ea4
commit 7a14987c02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -576,7 +576,12 @@ impl DapStore {
const LIMIT: usize = 100;
if value.len() > LIMIT {
value.truncate(LIMIT);
let mut index = LIMIT;
// If index isn't a char boundary truncate will cause a panic
while !value.is_char_boundary(index) {
index -= 1;
}
value.truncate(index);
value.push_str("...");
}