CaliDog / certstream-go

Go library for connecting to CertStream
MIT License
140 stars 33 forks source link

CertStreamEventStream panics on nil interfaces #6

Closed zuBux closed 6 years ago

zuBux commented 6 years ago

CertStreamEventStream crashes on the following line:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 81 [running]:
github.com/CaliDog/certstream-go.CertStreamEventStream.func1(0xc420458180, 0xc420458120, 0x0)
        /home/ubuntu/go/src/github.com/CaliDog/certstream-go/certstream.go:34 +0x33b
created by github.com/CaliDog/certstream-go.CertStreamEventStream
        /home/ubuntu/go/src/github.com/CaliDog/certstream-go/certstream.go:48 +0x97

The root cause is this. Maybe an additional check should be added?

Fitblip commented 6 years ago

Hey @zuBux,

Thanks for the bug report.

The root cause is this. Maybe an additional check should be added?

Hmm, so what do you think the additional check should be? One big beef I have with Go's empty interfaces is the API is very confusing when it comes to checking for if an empty interface is null 😓.

VegarLH commented 6 years ago

Does pull request #7 work for you @zuBux ?

zuBux commented 6 years ago

Hey,

Thanks for this! I'll test it today and let you know :)

Fitblip commented 6 years ago

Just to update this, we're hammering out some small details here and will shortly have this fixed :)

Fitblip commented 6 years ago

Hey @zuBux this should be fixed in #7 - thanks to @tcpepidemic for the fix!

zuBux commented 6 years ago

Thx!