Skip to content

Commit 49306be

Browse files
committed
update startWith: nullable subscription
1 parent bead78a commit 49306be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/streamx.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ extension StartWithExtension<T> on Stream<T> {
1717
onDone: controller.close,
1818
);
1919
};
20-
controller.onPause = () => subscription.pause();
21-
controller.onResume = () => subscription.resume();
22-
controller.onCancel = () => subscription.cancel();
20+
controller.onPause = () => subscription?.pause();
21+
controller.onResume = () => subscription?.resume();
22+
controller.onCancel = () => subscription?.cancel();
2323

2424
return controller.stream;
2525
}

0 commit comments

Comments
 (0)