feat: fixed nil pointer dereference in case of existing config file
This commit is contained in:
parent
4cb67b5097
commit
bb7542a437
|
@ -113,13 +113,15 @@ func (a *Action) Run() error {
|
||||||
|
|
||||||
// build repo config
|
// build repo config
|
||||||
configReader, err := a.GetConfigFile(repo.DefaultBranch)
|
configReader, err := a.GetConfigFile(repo.DefaultBranch)
|
||||||
if err != nil && err.Error() != "404 Not Found" {
|
if err != nil {
|
||||||
|
if err.Error() != "404 Not Found" {
|
||||||
return err
|
return err
|
||||||
} else if err.Error() == "404 Not Found" {
|
} else {
|
||||||
// no config file found
|
// no config file found
|
||||||
githubactions.Warningf("No such config file: .gitea/%s", a.config.ConfigPath)
|
githubactions.Warningf("No such config file: .gitea/%s", a.config.ConfigPath)
|
||||||
configReader = bytes.NewReader([]byte{})
|
configReader = bytes.NewReader([]byte{})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
config, err := config.ReadRepoConfig(configReader, repo.DefaultBranch)
|
config, err := config.ReadRepoConfig(configReader, repo.DefaultBranch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue