Skip to content
Merged
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
7 changes: 6 additions & 1 deletion lib/src/_code_highlight.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ class _CodeHighlightEngine {
return;
}
final Map<String, CodeHighlightThemeMode>? modes = _theme?.languages;
if (modes == null) {
// An empty language map means there is nothing to highlight, which is not
// a reason to fail. Without this the payload carried empty lists of sizes,
// `_run` reduced them, and `Bad state: No element` was thrown inside the
// isolate: highlighting died silently and left an unhandled exception in
// the console.
if (modes == null || modes.isEmpty) {
callback(const []);
return;
}
Expand Down