Skip to content

Commit 5317d34

Browse files
committed
protect against nil girepo close
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 7de0354 commit 5317d34

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/git/repo_base_nogogit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ func (repo *Repository) CatFileBatchCheck() (WriteCloserError, *bufio.Reader, fu
7171

7272
// Close this repository, in particular close the underlying gogitStorage if this is not nil
7373
func (repo *Repository) Close() {
74+
if repo == nil {
75+
return
76+
}
7477
if repo.batchCancel != nil {
7578
repo.batchCancel()
7679
repo.batchReader = nil

0 commit comments

Comments
 (0)