Don't go past the end of a batch row if the primary key is null