Skip to content

Commit 6ce140a

Browse files
kevinburkebradfitz
authored andcommitted
maintner: fix another panic
You can trigger this by creating a Corpus and only adding Gerrit repositories to it. These call parseGithubRefs, but c.github.repos is never initialized, so that function panics when you try to get c.github.repos. I'm a little worried I've triggered two of these recently; maybe it's worth it to initialize the data structures earlier instead of lazy-loading them. Change-Id: I8f80c0947d320aef0dd9391586c306460ac77eea Reviewed-on: https://go-review.googlesource.com/41305 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent eb48cb9 commit 6ce140a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

maintner/github.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,6 +1951,7 @@ func (c *Corpus) parseGithubRefs(gerritProj string, commitMsg string) []GitHubIs
19511951
2017/03/30 21:42:31 matches: [["GoogleCloudPlatform/gcloud-golang#262" "GoogleCloudPlatform" "gcloud-golang" "262"]]
19521952
2017/03/30 21:42:31 matches: [["GoogleCloudPlatform/google-cloud-go#481" "GoogleCloudPlatform" "google-cloud-go" "481"]]
19531953
*/
1954+
c.initGithub()
19541955
github := c.GitHub()
19551956
refs := make([]GitHubIssueRef, 0, len(ms))
19561957
for _, m := range ms {

0 commit comments

Comments
 (0)