Skip to content

Latest commit

 

History

History
14 lines (7 loc) · 415 Bytes

File metadata and controls

14 lines (7 loc) · 415 Bytes

Null Safety

Unlike Java, Kotlin distinguishes between nullable and non-nullable types. If you are handling possible null values, you need to decide what to do with them.

The safe (?) operator allows you to do this without and endless amount of if/else conditions.

Official Docs

https://kotlinlang.org/docs/reference/null-safety.html

Problem

  • Refactor the code to avoid the if (null) check