KaiSong-UK opened a new pull request, #18455: URL: https://github.com/apache/dolphinscheduler/pull/18455
## Purpose Fixes #18448 When the DAG component renders, the \startDisplay\ and \menuDisplay\ computed properties throw \TypeError: Cannot read properties of undefined (reading 'releaseState')\ because \workflowDefinition\ can be \undefined\ on the \props.definition\ object. ## Root Cause In \dag/index.tsx\, \startDisplay\ and \menuDisplay\ use: \\\ s props.definition!.workflowDefinition.releaseState \\\ The non-null assertion operator (\!\) has no runtime effect. When \props.definition.workflowDefinition\ is \undefined\, accessing \.releaseState\ throws \TypeError\. ## Changes Replace non-null assertions with optional chaining (\?.\) for safe property access: \\\diff - props.definition!.workflowDefinition.releaseState === 'ONLINE' + props.definition?.workflowDefinition?.releaseState === 'ONLINE' \\\ \\\diff - props.definition!.workflowDefinition.releaseState === 'OFFLINE' + props.definition?.workflowDefinition?.releaseState === 'OFFLINE' \\\ This matches the pattern already used in \dag-toolbar.tsx\ (\props.definition?.workflowDefinition?.releaseState\). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
