This is an English-language fictional programming exercise. Do not read or edit files, run commands, contact a network, use subagents, or save memory. Do not claim to have run tests. Return the complete corrected function in one JavaScript code block. Then explain the cause, the fix, one boundary case and what remains unverified.

Before calculating, reject every quantity that is not a positive integer. Throw RangeError with the exact message "quantity must be a positive integer". Keep the function name, the priceCents field and the existing total calculation. Valid prices are already supplied; do not add price validation.

function totalCents(lines) {
  return lines.reduce((sum, line) => sum + line.priceCents * line.quantity, 0);
}
Answer concisely, keeping every required technical detail. Do not invoke skills.