42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

panic in matterclient.(*Client).initUser #332

Closed vmpjdc closed 4 years ago

vmpjdc commented 4 years ago

I got the crash below on login after I switched to running from master.

Reverting cc8ab3ce7fa68bcfe844c60503bdf07207da4528 ("Update user after error checking") fixes it.

time="2020-10-19T10:57:52+13:00" level=info msg="Found version 5.27.0.5.27.0.3bd4fc983a4aa622183c3bd1e77029e0.true" prefix=matterclient
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x80b731]

goroutine 35 [running]:
github.com/42wim/matterircd/pkg/matterclient.(*Client).initUser(0xc0002f0000, 0x0, 0x0)
        /home/paul/go/src/github.com/42wim/matterircd/pkg/matterclient/matterclient.go:284 +0x91
github.com/42wim/matterircd/pkg/matterclient.(*Client).Login(0xc0002f0000, 0x4, 0x9a33c3)
        /home/paul/go/src/github.com/42wim/matterircd/pkg/matterclient/matterclient.go:135 +0xfa
github.com/42wim/matterircd/bridge/mattermost.(*Mattermost).loginToMattermost(0xc0002de7e0, 0xc0002b86a0, 0xc0002c3c08, 0x2, 0x2)
        /home/paul/go/src/github.com/42wim/matterircd/bridge/mattermost/mattermost.go:88 +0x2c5
github.com/42wim/matterircd/bridge/mattermost.New(0xc0001178c0, 0xc0002ac100, 0x4, 0xc000025970, 0x9, 0xc0002b0200, 0x20, 0xc000029380, 0x12, 0x0, ...)
        /home/paul/go/src/github.com/42wim/matterircd/bridge/mattermost/mattermost.go:45 +0x1a5
github.com/42wim/matterircd/mm-go-irckit.(*User).loginTo(0xc0000b2000, 0x98e4cc, 0xa, 0xc000318008, 0xa)
        /home/paul/go/src/github.com/42wim/matterircd/mm-go-irckit/userbridge.go:710 +0x490
github.com/42wim/matterircd/mm-go-irckit.login(0xc0000b2000, 0xc0000b2100, 0xc0002ba050, 0x2, 0x3, 0xc000318008, 0xa)
        /home/paul/go/src/github.com/42wim/matterircd/mm-go-irckit/service.go:160 +0x91c
github.com/42wim/matterircd/mm-go-irckit.(*User).handleServiceBot(0xc0000b2000, 0xc000318008, 0xa, 0xc0000b2100, 0xc0002da030, 0x2b)
        /home/paul/go/src/github.com/42wim/matterircd/mm-go-irckit/service.go:368 +0x36f
created by github.com/42wim/matterircd/mm-go-irckit.CmdPrivMsg
        /home/paul/go/src/github.com/42wim/matterircd/mm-go-irckit/server_commands.go:400 +0x765
42wim commented 4 years ago

Hm don't get it, are you using tokens or login/pass?

42wim commented 4 years ago

I do get it if you're using a token :)

vmpjdc commented 4 years ago

Yep, I'm using a token! :)

42wim commented 4 years ago

Should be fixed now :-) 🙏