Handle empty backtrace parameter gracefully (#448)

Fixes the issue that causes a panic when starting `state` command.
```
> go run ./cmd/state verifySnapshot

panic: expect file.go:234
```
This commit is contained in:
Igor Mandrigin 2020-04-13 13:04:10 +03:00 committed by GitHub
parent 1dcc7661fc
commit 161af5d1c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,9 +141,11 @@ func SetupCobra(cmd *cobra.Command) error {
if err != nil {
return err
}
err = glogger.BacktraceAt(backtrace)
if err != nil {
return err
if backtrace != "" {
err = glogger.BacktraceAt(backtrace)
if err != nil {
return err
}
}
log.Root().SetHandler(glogger)