Skip to content

Commit

Permalink
warp: fix crash when attempting to load old identity
Browse files Browse the repository at this point in the history
When the old identity is encountered, just recreate.

Signed-off-by: Mark Pashmfouroush <[email protected]>
  • Loading branch information
markpash committed Apr 2, 2024
1 parent e61a6de commit f902f25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions warp/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"log/slog"
Expand Down Expand Up @@ -355,6 +356,10 @@ func LoadIdentity(path string) (Identity, error) {
return Identity{}, err
}

if len(i.Config.Peers) < 1 {
return Identity{}, errors.New("identity contains 0 peers")
}

return *i, nil
}

Expand Down

0 comments on commit f902f25

Please sign in to comment.