Skip to content

Guard staff candidate pending fields in sibling pages#102

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/candidate-pending-field-guards
Open

Guard staff candidate pending fields in sibling pages#102
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/candidate-pending-field-guards

Conversation

@sentry

@sentry sentry Bot commented Jun 14, 2026

Copy link
Copy Markdown

This PR addresses a latent TypeError: Cannot read properties of null (reading 'filter') that could occur when the candidate detail API returns pendingField: null.

While candidate-form.page.ts already contained a robust guard for this (commit d3d8114), the same vulnerability existed in several sibling pages. The ?.pendingField?.filter(...) pattern, when pendingField is null, results in undefined.length, which throws an identical TypeError.

Changes:

  • Applied the Array.isArray(...) ? ... : [] guard to this.candidate.pendingField in:
    • src/app/pages/logged-in/candidate/candidate-invitations/candidate-invitations.page.ts
    • src/app/pages/logged-in/candidate/candidate-warning-list/candidate-warning-list.page.ts
    • src/app/pages/logged-in/candidate/candidate-salary-list/candidate-salary-list.page.ts
    • src/app/pages/logged-in/candidate/candidate-notes/candidate-notes.page.ts
    • src/app/pages/logged-in/candidate/candidate-suggestions/candidate-suggestions.page.ts
  • Updated the type definition for pendingField in src/app/models/candidate.ts from any[] to any[] | null to accurately reflect its possible null state from the API, improving type safety.

Fixes SH-STAFF-APP-8
Fixes TECH-2032

@linear-code

linear-code Bot commented Jun 14, 2026

Copy link
Copy Markdown

TECH-2032

@netlify

netlify Bot commented Jun 14, 2026

Copy link
Copy Markdown

Deploy Preview for studenthub-staff ready!

Name Link
🔨 Latest commit 4aedcb3
🔍 Latest deploy log https://app.netlify.com/projects/studenthub-staff/deploys/6a2e8bad09e75500080e5d67
😎 Deploy Preview https://deploy-preview-102--studenthub-staff.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants