Inspectopedia
 
2024.3

Return null or something nullable from a lambda in transformation method

Warning
Reliability
New
Last modified: 03 December 2024

Reports transform operations that may return null inside a Reactive Stream chain.

Reactive Streams don't support nullable values, which causes such code to fail. The quick-fix suggests replacing map() with mapNotNull, which omits exceptions.

Example:

After the quick-fix is applied:

New in 2019.3