Skip to content

Commit 69ce274

Browse files
committed
fix(billing): tighten early-return guard to handle empty additionalStats object
1 parent d1e72b4 commit 69ce274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/sim/lib/billing/core/usage-log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function recordUsage(params: RecordUsageParams): Promise<void> {
8989
const totalCost = validEntries.reduce((sum, e) => sum + e.cost, 0)
9090

9191
// Nothing to write: no cost entries and no counter increments
92-
if (validEntries.length === 0 && !additionalStats) {
92+
if (validEntries.length === 0 && (!additionalStats || Object.keys(additionalStats).length === 0)) {
9393
return
9494
}
9595

0 commit comments

Comments
 (0)