getResourceAsStream and Nulls

Nope. The problem is that the getResourceAsStream returns a object of type InputStream! which get’s converted to the non nullable version because of

val csvStream: InputStream = ...

The solution is to switch to either InputStream? or just let the compiler implicitly decide the type.

1 Like