Martin Erlic
Martin Erlic

Reputation: 5665

How to query Class by Pointer value in Parse (Java)?

I'm getting a NullPointer here, obviously because my query is not well formed. I was under the impression I could query for a Pointer column in my Class by just providing an object that matches it. Why doesn't the current user suffice?

    ParseUser currentUser = ParseUser.getCurrentUser();

    ParseQuery<ParseObject> requestsQuery = ParseQuery.getQuery("Request");
        requestsQuery.whereEqualTo("author", currentUser);
        requestsQuery.findInBackground(new FindCallback<ParseObject>() {
            @Override
            public void done(List<ParseObject> requestList, ParseException e) {
                if (e == null) {
                    log.info(requestList.toString());

                }

            }
     });

NullPointer:

[WARNING] 
java.lang.NullPointerException
    at com.nnit.automation.controller.IndexController$1.done(IndexController.java:58)
    at org.parse4j.ParseQuery$FindInBackgroundThread.run(ParseQuery.java:623)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

enter image description here

Upvotes: 0

Views: 186

Answers (0)

Related Questions