diff --git a/src/components/modals/ExportModal.jsx b/src/components/modals/ExportModal.jsx index 86b75d8..0a06571 100644 --- a/src/components/modals/ExportModal.jsx +++ b/src/components/modals/ExportModal.jsx @@ -32,7 +32,7 @@ class Gist extends React.Component { componentWillReceiveProps(nextProps) { this.setState({ ...this.state, - preview: !!nextProps.mapStyle.metadata['maputnik:openmaptiles_access_token'] + preview: !!(nextProps.mapStyle.metadata || {})['maputnik:openmaptiles_access_token'] }) } @@ -41,7 +41,7 @@ class Gist extends React.Component { ...this.state, saving: true }); - const preview = this.state.preview && this.props.mapStyle.metadata['maputnik:openmaptiles_access_token']; + const preview = this.state.preview && (this.props.mapStyle.metadata || {})['maputnik:openmaptiles_access_token']; const mapStyleStr = preview ? formatStyle(stripAccessTokens(style.replaceAccessToken(this.props.mapStyle))) : @@ -163,7 +163,7 @@ class Gist extends React.Component { Get your free access token