message: chore: should return if get a exception in Dashboard edit modal
diff: @@ -21,15 +21,15 @@ import { Input } from 'src/components/Input';
  import { FormItem } from 'src/components/Form';
  import jsonStringify from 'json-stringify-pretty-compact';
  import Button from 'src/components/Button';
  -import { AsyncSelect, Row, Col, AntdForm } from 'src/components';
  +import { AntdForm, AsyncSelect, Col, Row } from 'src/components';
  import rison from 'rison';
  import {
  - styled,
  - t,
  - SupersetClient,
  - getCategoricalSchemeRegistry,
  ensureIsArray,
  + getCategoricalSchemeRegistry,
  getSharedLabelColor,
  + styled,
  + SupersetClient,
  + t,
  } from '@superset-ui/core';
  import Modal from 'src/components/Modal';
  @@ -299,14 +299,22 @@ const PropertiesModal = ({
  let colorNamespace = '';
  let currentJsonMetadata = jsonMetadata;
  - // color scheme in json metadata has precedence over selection
  - if (currentJsonMetadata?.length) {
  + // validate currentJsonMetadata
  let metadata;
  try {
  + if (
  + !currentJsonMetadata.startsWith('{') ||
  + !currentJsonMetadata.endsWith('}')
  + ) {
  + throw new Error();
  + }
  metadata = JSON.parse(currentJsonMetadata);
  } catch (error) {
  addDangerToast(t('JSON metadata is invalid!'));
  + return;
  }
  +
  + // color scheme in json metadata has precedence over selection
  currentColorScheme = metadata?.color_scheme || colorScheme;
  colorNamespace = metadata?.color_namespace || '';
  @@ -318,14 +326,12 @@ const PropertiesModal = ({
  delete metadata.color_scheme_domain;
  }
  - const colorMap = getSharedLabelColor().getColorMap(
  + metadata.shared_label_colors = getSharedLabelColor().getColorMap(
  colorNamespace,
  currentColorScheme,
  true,
  );
  - metadata.shared_label_colors = colorMap;
  -
  if (metadata?.color_scheme) {
  metadata.color_scheme_domain =
  categoricalSchemeRegistry.get(colorScheme)?.colors || [];
  @@ -334,7 +340,6 @@ const PropertiesModal = ({
  }
  currentJsonMetadata = jsonStringify(metadata);
  - }
  onColorSchemeChange(currentColorScheme, {
  updateMetadata: false,
  