Check if appID and instID are non-empty before attempting to parseInt (#2463)
This commit is contained in:
parent
e45e4c53f1
commit
a7ef871248
|
|
@ -285,17 +285,21 @@ func secretDataToGitHubClientConfig(data map[string][]byte) (*github.Config, err
|
||||||
|
|
||||||
appID := string(data["github_app_id"])
|
appID := string(data["github_app_id"])
|
||||||
|
|
||||||
|
if appID != "" {
|
||||||
conf.AppID, err = strconv.ParseInt(appID, 10, 64)
|
conf.AppID, err = strconv.ParseInt(appID, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
instID := string(data["github_app_installation_id"])
|
instID := string(data["github_app_installation_id"])
|
||||||
|
|
||||||
|
if instID != "" {
|
||||||
conf.AppInstallationID, err = strconv.ParseInt(instID, 10, 64)
|
conf.AppInstallationID, err = strconv.ParseInt(instID, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
conf.AppPrivateKey = string(data["github_app_private_key"])
|
conf.AppPrivateKey = string(data["github_app_private_key"])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue