Add some null checks.

Noticed these when using the mock provider.

Change-Id: I446699f30ecb8e1e04d2ee96ea05137c8fa0b907
2 files changed