nil deref fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-15 15:38:12 +11:00
parent debac1f684
commit 645a20829f
2 changed files with 16 additions and 3 deletions

View File

@@ -436,7 +436,12 @@ SELECT
COALESCE(agg.any_creation, agg.first_present, 0) AS "CreationTime",
CASE
WHEN NULLIF(agg.inv_deletion, 0) IS NOT NULL THEN NULLIF(agg.inv_deletion, 0)
WHEN totals.max_snapshot IS NOT NULL AND agg.last_present < totals.max_snapshot THEN COALESCE(NULLIF(agg.any_deletion, 0), totals.max_snapshot, agg.last_present)
WHEN totals.max_snapshot IS NOT NULL AND agg.last_present < totals.max_snapshot THEN COALESCE(
NULLIF(agg.any_deletion, 0),
(SELECT MIN(s2."SnapshotTime") FROM snapshots s2 WHERE s2."SnapshotTime" > agg.last_present),
totals.max_snapshot,
agg.last_present
)
ELSE NULLIF(agg.any_deletion, 0)
END AS "DeletionTime",
(