Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for npe in segment's flatmap #937

Merged
merged 2 commits into from
Sep 29, 2017

Conversation

tscholak
Copy link
Contributor

I detected this issue when I was running old code that I ported from 0.9 to 0.10. I discovered that there is the real possibility of a null pointer exception in the flatMap method of Segment, see the backtrace here: http://lpaste.net/358781

This problem is related to #922 where a null pointer exception was discovered and fixed in the flatMapAccumulate method, also of Segment.

I tested the fix with my code, and the problem has disappeared.

Take this fix with a grain of salt. It might be incorrect. I can't say I understand the segment stepper code very well. I followed the types and used common sense to create this solution.

mpilquist and others added 2 commits September 28, 2017 19:04
More eager version of a scan: emits values immediately upon calculation
@tscholak
Copy link
Contributor Author

PS: no idea why gh picked up changes in Stream.scala.

@mpilquist
Copy link
Member

Thanks for finding this and fixing!

@mpilquist mpilquist merged commit a928677 into typelevel:series/0.10 Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants