Add more checks for helping with b/284236137.

Bug: 284236137
Test: test.py
Change-Id: I5458c19c617eddd569eb8bc9f56a2b14c1b235c9
1 file changed