Skip to content

Schema - Fix crash when editing a field with a null description (stable hotfix)#4198

Open
agalin920 wants to merge 1 commit into
stablefrom
hotfix/schema-null-description-crash
Open

Schema - Fix crash when editing a field with a null description (stable hotfix)#4198
agalin920 wants to merge 1 commit into
stablefrom
hotfix/schema-null-description-crash

Conversation

@agalin920

@agalin920 agalin920 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Hotfix to stable for a live production crash. Editing (or opening the Add/Edit modal for) a Schema field whose description is null crashes the app:

TypeError: Cannot read properties of null (reading 'length')
    at getErrorMessage (src/apps/schema/src/app/utils/index.ts:114)

description is null for legacy and API-created fields — most fields created before the description field existed. This has been live on stable since the 2026-07-01 Stable Release (#4177).

Root cause

PR #4127 added validate: ["length"] to the description config entry, routing its value through getErrorMessage for the first time. description is the only validated input whose hydrated value can be null, and the length check called value.length without a null guard.

Fix

Guard the length check in getErrorMessage so a null/empty value is treated as no error. Same one-line fix as the dev PR (#4197); this hotfix stops the bleeding on stable directly rather than waiting for the dev → stage → beta → stable cascade.

closes #4196

Fields whose description is null (legacy and API-created fields store it
as null) crashed the Add/Edit Field modal on open with "Cannot read
properties of null (reading 'length')". PR #4127 added a length
validation to the description field, routing its value through
getErrorMessage, which called value.length without guarding against null.
Guard the length check so a null value is treated as no error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@agalin920 agalin920 requested a review from shrunyan July 8, 2026 18:04
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Overall Coverage

Lines Statements Branches Functions
59.84% 59.50% 54.69% 54.24%

Changed Files Coverage

File Lines Statements Branches Functions
src/apps/schema/src/app/utils/index.ts 98.27% 95.00% 87.50% 100.00%

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.

1 participant