dart-lang / stream_transform

Dart utility methods to create StreamTransfomer instances to manipulate Streams

Home Page:https://pub.dev/packages/stream_transform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

asyncMapSample crashes on null values

leonsenft opened this issue · comments

I tried using asyncMapSample on a Stream<void> (to which I'm passing null since the data doesn't matter) and found that it crashes immediately due to the following null assertion:

controller.add(currentResults!);

One can work around this issue for a Stream<void> by passing a non-null object since the value doesn't matter, but I suspect this prevents this extension method from being used on a stream of nullable values (e.g. Stream<String?>).