Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix panic if hooks are not passed #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nikpivkin
Copy link

Fixes:

 go run .
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x100a26f90]

goroutine 1 [running]:
github.com/sosedoff/gitkit.(*HookScripts).setupInDir(0x0, {0x1400009a5a0?, 0x140000b8ea0?})
        /Users/nikita/go/pkg/mod/github.com/sosedoff/[email protected]/config.go:31 +0xb0
github.com/sosedoff/gitkit.(*Config).setupHooks(0x140000f0180)
        /Users/nikita/go/pkg/mod/github.com/sosedoff/[email protected]/config.go:95 +0xec
github.com/sosedoff/gitkit.(*Config).Setup(0x140000f0180)
        /Users/nikita/go/pkg/mod/github.com/sosedoff/[email protected]/config.go:76 +0x58
github.com/sosedoff/gitkit.(*Server).Setup(...)
        /Users/nikita/go/pkg/mod/github.com/sosedoff/[email protected]/http.go:224
main.main()
        /Users/nikita/projects/gitkit-test/main.go:7 +0x330
exit status 2

Code:

package main

import "github.com/sosedoff/gitkit"

func main() {
	server := gitkit.New(gitkit.Config{AutoHooks: true, Dir: "test"})
	server.Setup()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant