fix wrong check on empty relation array #312