Add nullness check to avoid crashing.

Bug: 317445993
Test: unit Test
Change-Id: I7e229455ea54f4f6a152884f981f008f06d8ddf6
2 files changed