diff --git a/src/ic/ic-dialog.js b/src/ic/ic-dialog.js index cba6291..eff8ef0 100644 --- a/src/ic/ic-dialog.js +++ b/src/ic/ic-dialog.js @@ -46,6 +46,22 @@ class ICDialog extends React.Component { FileSaver.saveAs(blob, this.props.ic.name + ".svg"); } + isJSON(data){ + if (data === undefined || data === null){ + return false; + } + let str = JSON.stringify(data); + try + { + JSON.parse(str) + } + catch(ex){ + return false + } + + return true + } + render() { @@ -90,14 +106,19 @@ class ICDialog extends React.Component {