This null check is a bit strange since we in the code below `record = record._nextRec` already assume that `record != null`.