Primary finding
Possible null/undefined dereference when printing finding title
mediumbugmedium
- apps/web/scripts/inspect-finding-status.ts:51
r.title is read directly from the database selection (findingStatus.title). If the column is nullable or a row has a null/undefined title due to data inconsistencies, calling .slice on a non-string will throw and crash the script. Other optional fields (e.g., closureDetectedAt) are already guarded, suggesting this title could also benefit from a safe fallback.
Recommendation
Defensively handle potential null values: use (r.title ?? "").slice(0, 60), or coalesce in SQL to an empty string, or enforce non-nullability at the schema level and add runtime assertions that produce a clear error message.