我在这里得到一个NullPointer,显然是因为我的查询格式不正确。我的印象是,我可以通过提供匹配它的对象来查询我的类中的Pointer列。为什么当前用户不够?
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());
}
}
});
空指针:
[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)