Skip to content

Commit 30fc341

Browse files
committed
warp: fix crash when attempting to load old identity
When the old identity is encountered, just recreate. Signed-off-by: Mark Pashmfouroush <mark@markpash.me>
1 parent e61a6de commit 30fc341

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

warp/account.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"context"
66
"encoding/json"
7+
"errors"
78
"fmt"
89
"io"
910
"log/slog"
@@ -355,6 +356,10 @@ func LoadIdentity(path string) (Identity, error) {
355356
return Identity{}, err
356357
}
357358

359+
if len(i.Config.Peers) < 1 {
360+
return Identity{}, errors.New("identity contains 0 peers")
361+
}
362+
358363
return *i, nil
359364
}
360365

0 commit comments

Comments
 (0)