dengliming opened a new issue, #644:
URL: https://github.com/apache/shenyu-dashboard/issues/644

   ## Description
   Several components dereference nested fields that the server can 
legitimately return as null/empty.
   
   ## Location
   (Lines refer to `master @ 83969a5`.)
   - `src/routes/Document/components/ApiInfo.js:163` – 
`apiDetail.tags[apiDetail.tags.length - 1].name` throws when `tags` is 
undefined or empty
   - `src/routes/Plugin/Discovery/ProxySelectorModal.js:100` – 
`Object.keys(props)` throws when selector `props` is null (which 
`DiscoveryCard` explicitly anticipates)
   - `src/routes/Plugin/Discovery/ProxySelectorModal.js:116` – 
`handlerArray[0].defaultValue` with no guard (unlike `Selector.js`)
   - `src/routes/Plugin/Discovery/DiscoveryConfigModal.js:53,65` – `data.props` 
null leads to `Object.entries(null)` in render
   
   ## Impact
   An API record without tags crashes the ApiDoc page; a TCP selector with null 
props or a plugin without handle definitions crashes the proxy selector modal.
   
   ## Suggested fix
   Use optional chaining / defaults (`tags?.at(-1)?.name`, `Object.keys(props 
?? {})`, `handlerArray?.[0]?.defaultValue`).
   
   ## Related existing
   None
   


-- 
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]

Reply via email to