Handle case of empty (new) account

This commit is contained in:
Christopher Goes 2018-05-03 23:19:56 +02:00
parent 05988623af
commit 10540e38db
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 5 additions and 0 deletions

View File

@ -158,6 +158,11 @@ func (ctx CoreContext) NextSequence(address []byte) (int64, error) {
return 0, err
}
if len(res) == 0 {
fmt.Printf("No account found, defaulting to sequence 0\n")
return 0, err
}
account, err := ctx.Decoder(res)
if err != nil {
panic(err)