Skip to content

Commit d7cd9c8

Browse files
authored
Added null check
? adds a safe null check to prevent a failure if the setting does not exist yet
1 parent ae681d4 commit d7cd9c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Settings.ascx.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ private void Page_Load(System.Object sender, System.EventArgs e)
382382
}
383383

384384
bool emailOnDownload = false;
385-
if (bool.TryParse(settings["EmailOnDownload"].ToString(), out emailOnDownload) == true)
385+
if (bool.TryParse(settings["EmailOnDownload"]?.ToString(), out emailOnDownload) == true)
386386
{
387387
cbxEmailOnDownload.Checked = emailOnDownload;
388388
}

0 commit comments

Comments
 (0)