Skip to content

Files

Latest commit

 

History

History
21 lines (14 loc) · 415 Bytes

prefer_null_aware_operators.md

File metadata and controls

21 lines (14 loc) · 415 Bytes

Pattern: Missing use of null-aware operator

Issue: -

Description

Prefer using null-aware operators instead of null checks in conditional expressions.

Example of incorrect code:

v = a == null ? null : a.b;

Example of correct code:

v = a?.b;

Further Reading