So, I have a query in parse that has to find objects based on whether a key is equal to a certain object. Here is the few lines of code.
var gamesQuery = PFQuery(className: "Games")
gamesQuery.whereKey("challenged", equalTo: (PFUser.currentUser()!.objectId!))
gamesQuery.whereKey("challenger", equalTo: PFUser.currentUser()!)
However, when this query is ran, the query is occasionally found as nil due to the fact that there is no object that fits the search parameters.
Is there any check that I could run that could check if
gamesQuery.whereKey("challenged", equalTo: (PFUser.currentUser()!.objectId!))
is nil? Any help with this issue would be very appreciated.