mirror of
https://github.com/status-im/burnchart.git
synced 2025-01-19 07:03:27 +00:00
fix Cannot read property '1' of null
when an issue has more than one label
This commit is contained in:
parent
0dad78e225
commit
f702c3adc8
@ -45,9 +45,14 @@ module.exports =
|
||||
{ labels, number } = issue
|
||||
number ?= '?'
|
||||
return false unless labels
|
||||
switch ( {} for { name } in labels when name and regex.test(name) ).length
|
||||
# Find size labels only
|
||||
size_labels = _.filter(labels, (label) ->
|
||||
regex.test label.name
|
||||
)
|
||||
switch size_labels.length
|
||||
when 0 then false
|
||||
when 1
|
||||
name = size_labels[0].name
|
||||
# Provide the size attribute on the issue.
|
||||
total += issue.size = parseInt name.match(regex)[1]
|
||||
true
|
||||
|
Loading…
x
Reference in New Issue
Block a user