Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/coldvox-text-injection/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,12 @@ impl StrategyManager {
.await
{
if let Some(obj_ref) = matches.pop() {
if !obj_ref.name.is_empty() {
return Ok(obj_ref.name.to_string());
if let Some(name) = obj_ref.name_as_str() {
if !name.is_empty() {
return Ok(name.to_string());
}
}
if let Some(last) = obj_ref.path.rsplit('/').next() {
if let Some(last) = obj_ref.path_as_str().rsplit('/').next() {
if !last.is_empty() {
return Ok(last.to_string());
}
Expand Down
4 changes: 2 additions & 2 deletions crates/coldvox-text-injection/src/prewarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ impl PrewarmController {
// Store the focused node
focused_node = Some("focused".to_string());

Comment on lines 214 to 215
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ GOOD: Correctly handles the Option return type with .map() for the name field, avoiding potential null pointer dereference.

target_app = Some(obj_ref.name.to_string());
window_id = Some(obj_ref.path.to_string());
target_app = obj_ref.name_as_str().map(|s| s.to_string());
window_id = Some(obj_ref.path_as_str().to_string());

// Simplified editable text check - assume it's editable if we found a focused element
has_editable_text = true;
Expand Down