Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

NullReferenceException when accessing "steamLogin" cookie #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions Source/IdleMaster/CookieClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ protected override WebResponse GetWebResponse(WebRequest request, System.IAsyncR

// Check, if cookie should be deleted. This means that sessionID is now invalid and user has to log in again.
// Maybe this shoud be done other way (authenticate exception), but because of shared settings and timers in frmMain...
if (cookies.Count > 0)
Cookie loginCookie = cookies["steamLogin"];
if (loginCookie != null && loginCookie.Value == "deleted")
{
if (cookies["steamLogin"] != null && cookies["steamLogin"].Value == "deleted")
{
Settings.Default.sessionid = string.Empty;
Settings.Default.steamLogin = string.Empty;
Settings.Default.steamparental = string.Empty;
Settings.Default.steamMachineAuth = string.Empty;
Settings.Default.steamRememberLogin = string.Empty;
Settings.Default.Save();
}
Settings.Default.sessionid = string.Empty;
Settings.Default.steamLogin = string.Empty;
Settings.Default.steamparental = string.Empty;
Settings.Default.steamMachineAuth = string.Empty;
Settings.Default.steamRememberLogin = string.Empty;
Settings.Default.Save();
}

this.ResponseUri = baseResponse.ResponseUri;
Expand Down