Skip to content

Commit

Permalink
[CHORE] add SeoController not found exception (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
krokyze authored Jan 14, 2024
1 parent a265f12 commit d7554f7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/html/seo_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ class SeoController extends StatefulWidget {
required SeoTag tag,
required Widget child,
}) {
return context
.dependOnInheritedWidgetOfExactType<_InheritedSeoTreeWidget>()!
.tree
.process(tag, child);
final tree = context
.dependOnInheritedWidgetOfExactType<_InheritedSeoTreeWidget>()
?.tree;

if (tree == null) {
throw Exception('SeoController not found');
}

return tree.process(tag, child);
}
}

Expand Down

0 comments on commit d7554f7

Please sign in to comment.