Checking for null in subtreematching