simeji/jid

panic on invalid json

aeosynth opened this issue · 2 comments

$ echo '' | jid
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x469292]

goroutine 1 [running]:
panic(0x513220, 0xc42000a0e0)
        /usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1
github.com/simeji/jid.(*JsonManager).GetFilteredData(0x0, 0x0, 0x0, 0xc420039b00, 0xc420039be0, 0x43bb3b, 0xc420039be0, 0x42fdce, 0xc420039bb8, 0x4a51d1, ...)
        /Users/ts/go/src/github.com/simeji/jid/json_manager.go:63 +0x42
github.com/simeji/jid.(*JsonManager).GetPretty(0x0, 0x0, 0x0, 0x0, 0xbf00000004,
0x7f1c030000000a30, 0x1a13110001000415, 0xc420039cc8, 0x425d33, 0xc420039c98, ...)
        /Users/ts/go/src/github.com/simeji/jid/json_manager.go:54 +0x66
github.com/simeji/jid.(*Engine).getContents(0xc420090000, 0x544748, 0x543513, 0x543512)
        /Users/ts/go/src/github.com/simeji/jid/engine.go:160 +0x5d
github.com/simeji/jid.(*Engine).Run(0xc420090000, 0x0, 0x0)
        /Users/ts/go/src/github.com/simeji/jid/engine.go:92 +0xb4
main.run(0x5babe0, 0xc420090000, 0x5bab00, 0xc420090000)
        /Users/ts/go/src/github.com/simeji/jid/cmd/jid.go:24 +0x49
main.main()
        /Users/ts/go/src/github.com/simeji/jid/cmd/jid.go:19 +0xc5

@aeosynth thanks, I've made a mistake. I'll fix.

@aeosynth I fixed it.
dde1cd2