1

I am trying to see if an objects relation is null, if not then continue on. It keeps crashing on this line throwing a NullPointerException. How would I resolve this? I'm trying to see if this is null or not to begin with, but it just crashes saying NullPointerException?

    if (currentObject.getRelation("interested") != null)

where currentObject is the ParseObject.

Joey
  • 221
  • 3
  • 10
  • possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – BackSlash Nov 14 '14 at 23:55
  • Fixed the issue, I'm a moron and didn't realize the currentObject wasn't being set yet as it was being called inside a block. – Joey Nov 14 '14 at 23:57
  • Yeah, that's about the only way that line could throw an NPE. – ash Nov 14 '14 at 23:58

0 Answers0