Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 437 Bytes

PH_B013.md

File metadata and controls

9 lines (5 loc) · 437 Bytes

PH_B013 - Null-Check Against Task Instead of Value

Problem

Asynchronous methods usually do not return null in place of a task, especially if the method is defined using the async keyword. Therefore, a null-check against the returned task is unnecessary or resulted from a typo.

Solution

Retrieve the value represented by the task by awaiting its completion using await and apply the null-check on the actual value.