Fix NPE error

Reviewer: Tiffany Go

Issue: GCP-8078