From 24fb3a8b6219660cd21d1e1ef67a798fe4ee7700 Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Thu, 2 Apr 2026 13:23:34 +0200 Subject: [PATCH] fix: prevent segfault in login command when session doesn't exist LoadSession() was returning nil when the session file didn't exist (first login). The login command then tried to dereference nil when setting session.Token, causing a panic. Now LoadSession() returns an empty Session with the path set, so callers can always use the returned session. Co-Authored-By: Claude Haiku 4.5 --- src/store/session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/session.go b/src/store/session.go index 9294b4c..1c005ec 100644 --- a/src/store/session.go +++ b/src/store/session.go @@ -22,7 +22,7 @@ func LoadSession() (*Session, error) { data, err := os.ReadFile(path) if err != nil { if os.IsNotExist(err) { - return nil, nil + return &Session{path: path}, nil } return nil, err }