Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 8ccf997

Browse files
Fixing logic error in NeedsLoad
Credential might be null and we should be loading if there is no token
1 parent 977b32e commit 8ccf997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GitHub.Api/Authentication/Keychain.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,6 @@ private void UpdateConnections(Connection[] conns)
323323
public Connection[] Connections => connections.Values.ToArray();
324324
public IList<UriString> Hosts => connections.Keys.ToArray();
325325
public bool HasKeys => connections.Any();
326-
public bool NeedsLoad => HasKeys && !string.IsNullOrEmpty(FindOrCreateAdapter(connections.First().Value.Host).Credential.Token);
326+
public bool NeedsLoad => HasKeys && string.IsNullOrEmpty(FindOrCreateAdapter(connections.First().Value.Host).Credential?.Token);
327327
}
328328
}

0 commit comments

Comments
 (0)