diff --git a/src/pages/Project/index.js b/src/pages/Project/index.js index b9bd6f8..6f44133 100644 --- a/src/pages/Project/index.js +++ b/src/pages/Project/index.js @@ -191,10 +191,12 @@ export default connect( const { preview } = this.props const relativePathsRegex = new RegExp(/(?:href|src)=(["'])(?!mailto|https|http|data:).*?\1/g) let matches = preview.content.match(relativePathsRegex) - matches = matches.map(match => `■ ${match}`) - this.props.addAlert(['Found possible non-absolute paths:', ...matches], 'error', { - autoHide: false, - }) + if (matches) { + matches = matches.map(match => `■ ${match}`) + this.props.addAlert(['Found possible non-absolute paths:', ...matches], 'error', { + autoHide: false, + }) + } } getHTMLOutput() {