mirror of
https://github.com/status-im/figma-diff-probot.git
synced 2025-02-19 15:54:29 +00:00
Fix crash when files don't match regex
This commit is contained in:
parent
090ece7eb0
commit
35f24cd42a
6
index.js
6
index.js
@ -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()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user