I have a frustrating issue that my app on Google Appengine throws NullPointerException like:

```
java.lang.NullPointerException
    at com.google.appengine.api.users.User.equals(User.java:143)

```

My code looks like:

```
if (excludeUser.equals(someEntity.getProperty("user")))

```

The user property in the entity was another User object previously stored in the datastore. Even if I change the code to something like the following, it does not raise the exception:

```
if (excludeUser.equals(null))

```

So I guess it's some internal logic in User.equals causes the problem, or some other tricky thing when storing the user object into the datastore? 

In addition, the logic works well in development environment. The problem only happens on GAE. 

I'm using the Google Accounts API, not the Federated login. I tried them both. The same result. Any clue is appreciated, thanks.