diff --git a/app/lib/features/chat/ui/transcript/chat_find_highlight.dart b/app/lib/features/chat/ui/transcript/chat_find_highlight.dart index d4219007..96dea40c 100644 --- a/app/lib/features/chat/ui/transcript/chat_find_highlight.dart +++ b/app/lib/features/chat/ui/transcript/chat_find_highlight.dart @@ -143,7 +143,11 @@ class _ChatFindHighlightState extends State { void _register(ChatFindTargets? targets, String? rowKey) { final next = rowKey == null ? null : (rowKey, widget.text); if (identical(targets, _targets) && next == _registered) { - if (next != null) targets!.texts[next.$1]![next.$2] = widget.rects; + // Another text with the same row and string may have unregistered + // the shared entry; put it back. + if (next != null) { + targets!.texts.putIfAbsent(next.$1, () => {})[next.$2] = widget.rects; + } return; } _unregister();