Add a null check for the result of nullable API.

Bug: 285671104
Fixes: 285671104
Test: presubmit
Change-Id: I58730eb38bcef7d8c231a60c0927f2848bafd3a5
2 files changed