Added check in join for null conditions when not doing a cross join