Skip to content

Commit

Permalink
Avoid System.DBNull accessing
Browse files Browse the repository at this point in the history
Mentioned in: #31
  • Loading branch information
JonasNilson committed Jun 7, 2020
1 parent 8c69fdb commit cbc57d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/IdleMaster/frmBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted
// Find the page header, and remove it. This gives the login form a more streamlined look.
dynamic htmldoc = wbAuth.Document.DomDocument;
dynamic globalHeader = htmldoc.GetElementById("global_header");
if (globalHeader != null)
if (globalHeader != null && !(globalHeader is DBNull))
{
try
{
Expand Down Expand Up @@ -101,7 +101,7 @@ private void wbAuth_DocumentCompleted(object sender, WebBrowserDocumentCompleted
try
{
dynamic parentalNotice = htmldoc.GetElementById("parental_notice");
if (parentalNotice != null)
if (parentalNotice != null && !(parentalNotice is DBNull))
{
if (parentalNotice.OuterHtml != "")
{
Expand Down Expand Up @@ -131,7 +131,7 @@ private void setLoginButtonText(dynamic htmldoc, string text)
{
dynamic steamLoginButton = htmldoc.GetElementById("SteamLogin");

if (steamLoginButton != null)
if (steamLoginButton != null && !(steamLoginButton is DBNull))
{
steamLoginButton.Value = text;
}
Expand Down

0 comments on commit cbc57d6

Please sign in to comment.