zhaoyongjie commented on code in PR #20823:
URL: https://github.com/apache/superset/pull/20823#discussion_r972529938
##########
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx:
##########
@@ -294,7 +296,12 @@ const PropertiesModal = ({
// color scheme in json metadata has precedence over selection
if (currentJsonMetadata?.length) {
- const metadata = JSON.parse(currentJsonMetadata);
+ let metadata;
+ try {
+ metadata = JSON.parse(currentJsonMetadata);
+ } catch (error) {
+ addDangerToast(t('JSON metadata is invalid!'));
Review Comment:
@etr2460 good point, let's try to make an invalid JSON to verify.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]