A conditional access with ?
to a type member or a cast with as
means that the value may be null
. However, the access result is asynchronously awaited using the await
keyword, although null
cannot be awaited and ends in a System.NullReferenceException
.
Guard the await
using an if-statement or reconsider that possibility if this particular member can be null
.