Merge "Guard against NPE in equals checks." into nyc-dev