Fix crash when files don't match regex

This commit is contained in:
Pedro Pombeiro 2019-02-27 14:20:05 +01:00
parent 090ece7eb0
commit 35f24cd42a
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
2 changed files with 5285 additions and 1 deletions

View File

@ -84,7 +84,11 @@ module.exports = robot => {
let data = {}
diff.match(/^[-+]\s.*www\.figma\.com\/file\/.+\//gm).forEach(m => {
const regexMatch = diff.match(/^[-+]\s.*www\.figma\.com\/file\/.+\//gm)
if (!regexMatch) {
return
}
regexMatch.forEach(m => {
data[m[0] === '-' ? 'before' : 'after'] = {
'fileId': /www\.figma\.com\/file\/(.+)\//.exec(m).pop()
}

5280
yarn.lock Normal file

File diff suppressed because it is too large Load Diff