That will work just fine. The only time that becomes a problem (which will not happen in this case) is if the result returns -1 if there are no nodes found. That is because -1 will evaluate to true.