Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 435 Bytes

prefer_null_aware_method_calls.md

File metadata and controls

23 lines (14 loc) · 435 Bytes

Pattern: Missing use of null-aware method call

Issue: -

Description

Instead of checking nullability of a function/method f before calling it you can use f?.call().

Example of incorrect code:

if (f != null) f!();

Example of correct code:

f?.call();

Further Reading