From 405914c58633f7840b0a81a4c67c2f41348705af Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Fri, 23 Jan 2026 21:59:33 -0800 Subject: [PATCH] Fix subtotal/itemCount null handling in history API Use val() instead of ?: for SUM results that may be empty strings Co-Authored-By: Claude Opus 4.5 --- api/orders/history.cfm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/orders/history.cfm b/api/orders/history.cfm index d197b1e..85b05e5 100644 --- a/api/orders/history.cfm +++ b/api/orders/history.cfm @@ -109,8 +109,8 @@ try { AND (OrderLineItemIsDeleted = 0 OR OrderLineItemIsDeleted IS NULL) ", { orderId: { value = row.OrderID, cfsqltype = "cf_sql_integer" } }); - itemCount = qItems.ItemCount ?: 0; - subtotal = qItems.Subtotal ?: 0; + itemCount = val(qItems.ItemCount); + subtotal = val(qItems.Subtotal); tax = subtotal * 0.0875; total = subtotal + tax;