Fix null object in validation