dengliming opened a new issue, #639: URL: https://github.com/apache/shenyu-dashboard/issues/639
## Description The validator calls `callback()` for non-string values and then falls through to the `handleType === "2"` branch, where `JSON.parse(value)` runs on `undefined`, throws, and `callback(error)` is called a second time. async-validator honours the first callback, so an empty JSON textarea passes validation. ## Location (Lines refer to `master @ 83969a5`.) - `src/routes/Plugin/Common/CommonRuleHandle.js:246-256` ## Impact With no plugin-handle fields (handleType "2"), leaving the JSON textarea empty and submitting sends `handle: undefined` instead of showing a validation error. ## Suggested fix `return callback()` in the early branch (or restructure with `else`), and wrap `JSON.parse` in `try/catch` that calls `callback` exactly once. ## 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]
