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

   ## Description
   `ProxySelectorCopy.handleOk` looks up the selected selector and always calls 
`onOk(data)` even when `data` is `undefined`. 
`ProxySelectorModal.handleCopyData` destructures `copyData` without a guard 
(`SelectorCopy`/`RuleCopy` in `Common/` guard with `if (!copyData) return`). It 
also reads `discovery.type` / `discovery.serverList`, which throws when the 
copied selector has a `null` `discovery`.
   
   ## Location
   (Lines refer to `master @ 83969a5`.)
   - `src/routes/Plugin/Discovery/ProxySelectorCopy.js:54-65`
   - `src/routes/Plugin/Discovery/ProxySelectorModal.js:180-189`
   
   ## Impact
   Opening "Copy" on the TCP proxy selector modal and pressing OK without 
choosing an entry throws an uncaught `TypeError` and the modal breaks.
   
   ## Suggested fix
   Return early in `handleOk` when nothing is selected (or disable OK), guard 
`if (!copyData) return;` in `handleCopyData`, and use optional chaining for 
`discovery`.
   
   ## 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