Merge "Explicitly handle null rather than relying on NPE." into nyc-dev