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

Invalid memory address or nil pointer dereference on main.go:22 #1

Closed
csiszarattila opened this issue May 21, 2015 · 2 comments
Closed
Labels

Comments

@csiszarattila
Copy link

Using the latest relase (v0.1.7) I got the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x8048cba]

goroutine 1 [running]:
main.main()
    /Users/ikent/dev/src/github.com/mailhog/mhsendmail/main.go:22 +0xba

goroutine 2 [runnable]:
runtime.forcegchelper()
    /usr/local/Cellar/go/1.4/libexec/src/runtime/proc.go:90
runtime.goexit()
    /usr/local/Cellar/go/1.4/libexec/src/runtime/asm_386.s:2287 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
    /usr/local/Cellar/go/1.4/libexec/src/runtime/mgc0.go:82
runtime.goexit()
    /usr/local/Cellar/go/1.4/libexec/src/runtime/asm_386.s:2287 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
    /usr/local/Cellar/go/1.4/libexec/src/runtime/malloc.go:712
runtime.goexit()
    /usr/local/Cellar/go/1.4/libexec/src/runtime/asm_386.s:2287 +0x1

Now, I'm not a go expert, but I think user != nil need to be used instead of user == nil on line 22 in main.go :

if err != nil && user == nil && len(user.Username) > 0 {
    username = user.Username
}
@ian-kent
Copy link
Member

Sorry, that if statement couldn't have been much further from what I intended! Hopefully thats fixed it! I'll upload a new binary release now.

@eirc
Copy link

eirc commented Jun 16, 2015

This happens for the normal mailhog too, 0.1.7 is broken due to this. Care to release it too?

philipcofc added a commit to philipcofc/mhsendmail that referenced this issue Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants