We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e308d25 commit 1d25489Copy full SHA for 1d25489
models/activities/action.go
@@ -393,10 +393,14 @@ func (a *Action) GetCreate() time.Time {
393
return a.CreatedUnix.AsTime()
394
}
395
396
-// GetIssueInfos returns a list of issues associated with
397
-// the action.
+// GetIssueInfos returns a list of associated information with the action.
398
func (a *Action) GetIssueInfos() []string {
399
- return strings.SplitN(a.Content, "|", 3)
+ // make sure it always returns 3 elements, because there are some access to the a[1] and a[2] without checking the length
+ ret := strings.SplitN(a.Content, "|", 3)
400
+ for len(ret) < 3 {
401
+ ret = append(ret, "")
402
+ }
403
+ return ret
404
405
406
// GetIssueTitle returns the title of first issue associated with the action.
0 commit comments