Fix notification: --all dont relay on a repo (#159)

fix nil pointer exeption

make notifications work outside a repo

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/159
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: mrsdizzie <info@mrsdizzie.com>
This commit is contained in:
6543
2020-07-20 03:09:34 +00:00
parent a979df1070
commit edd180a8f5
2 changed files with 7 additions and 5 deletions

View File

@@ -197,6 +197,9 @@ func curGitRepoPath(path string) (*Login, string, error) {
} else {
repo, err = git.RepoFromPath(path)
}
if err != nil {
return nil, "", err
}
gitConfig, err := repo.Config()
if err != nil {
return nil, "", err