JohnStarich / sage

💸 Download from your banks and credit cards straight to your computer
GNU General Public License v3.0
65 stars 8 forks source link

Don't segfault on `./sage --help` #32

Closed aclindsa closed 4 years ago

aclindsa commented 4 years ago

Though harmless, this stops from printing the following after usage information when a user runs ./sage --help:

[...]
flag: help requested
{"level":"info","msg":"Shutting down"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xc0f8be]

goroutine 1 [running]:
github.com/johnstarich/sage/sync.Shutdown(0x0, 0x0, 0x2)
    ./sage/sync/sync.go:12 +0x7e
main.main()
    ./sage/main.go:189 +0x12b