ok-borg / borg

Search and save shell snippets without leaving your terminal
Apache License 2.0
1.61k stars 58 forks source link

Borg segv if the api is unreachable #36

Closed jeremyletang closed 7 years ago

jeremyletang commented 7 years ago

here is the stack trace:

➜  borg git:(master) ✗ ./borg search yolo
Error while making request: Get http://ok-b.org:9992/v1/query?l=5&p=false&q=search: dial tcp 127.0.0.1:9992: getsockopt: connection refused
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x7db66]

goroutine 1 [running]:
panic(0x30cee0, 0xc4200140d0)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/ok-borg/borg/commands.Query(0x7fff5fbffa7f, 0x6, 0x0, 0x0)
    /Users/jeremy/work/go/src/github.com/ok-borg/borg/commands/query.go:29 +0x2d6
main.main()
    /Users/jeremy/work/go/src/github.com/ok-borg/borg/main.go:19 +0x14f
0xmohit commented 7 years ago

Wasn't this resolved with https://github.com/ok-borg/borg/commit/bfc134b770e19dc3b020a6042d6b66b385beb079?

jeremyletang commented 7 years ago

Yes this commit must have fix this issue. I just forgot to close it. Do you experience any problem ?

0xmohit commented 7 years ago

No. Just figured that the issue should probably have been closed.