You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Non-null assertions on find() results can cause runtime crashes #11702
// Example from provider.ts:1051constfn=mod[Object.keys(mod).find((key)=>key.startsWith("create"))!]// If no key starts with "create", find() returns undefined// The ! assertion bypasses the type check but crashes at runtime
The ! (non-null assertion) operator tells TypeScript to trust that the value is not null/undefined, but if find() doesn't match any element, it returns undefined, causing "Cannot read property 'X' of undefined" errors.
Impact
Severity: Medium
Type: Runtime Error
Effect: Crashes when search predicate doesn't match
Suggested Fix
Replace non-null assertions with proper null checks:
Activity
github-actions commentedon Feb 2, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if these don't address your specific case.
fix: replace non-null assertions on find() with proper null checks
github-actions commentedon Apr 3, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.