Skip to content

Commit fa186a4

Browse files
authored
fix: check for has client before jumping in shrinkwrapped editor (#1045)
1 parent 429ab33 commit fa186a4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/src/editor/editor_component/service/scroll/editor_scroll_controller.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,16 @@ class EditorScrollController {
182182
required double offset,
183183
}) async {
184184
if (shrinkWrap) {
185-
return scrollController.jumpTo(
186-
offset.clamp(
187-
scrollController.position.minScrollExtent,
188-
scrollController.position.maxScrollExtent,
189-
),
190-
);
185+
if (scrollController.hasClients) {
186+
scrollController.jumpTo(
187+
offset.clamp(
188+
scrollController.position.minScrollExtent,
189+
scrollController.position.maxScrollExtent,
190+
),
191+
);
192+
}
193+
194+
return;
191195
}
192196

193197
final index = offset.toInt();

0 commit comments

Comments
 (0)