Skip to content

Commit

Permalink
fixing some nullability warnings (#2259)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepchoudhery committed Feb 7, 2023
1 parent 37100b2 commit 794b10f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<header>
<h1>@ViewData["Title"]</h1>
@{
if (User.Identity.IsAuthenticated)
if (User.Identity?.IsAuthenticated ?? false)
{
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post">
<button type="submit" class="nav-link btn btn-link text-dark">Click here to Logout</button>
Expand All @@ -18,4 +18,4 @@
<p>You have successfully logged out of the application.</p>
}
}
</header>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<header>
<h1>@ViewData["Title"]</h1>
@{
if (User.Identity.IsAuthenticated)
if (User.Identity?.IsAuthenticated ?? false)
{
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post">
<button type="submit" class="nav-link btn btn-link text-dark">Click here to Logout</button>
Expand All @@ -18,4 +18,4 @@
<p>You have successfully logged out of the application.</p>
}
}
</header>
</header>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@{
if (ViewData.TryGetValue("ParentLayout", out var parentLayout))
if (ViewData.TryGetValue("ParentLayout", out var parentLayout) && parentLayout != null)
{
Layout = (string)parentLayout;
Layout = parentLayout.ToString();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<header>
<h1>@ViewData["Title"]</h1>
@{
if (User.Identity.IsAuthenticated)
if (User.Identity?.IsAuthenticated ?? false)
{
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Page("/", new { area = "" })" method="post">
<button type="submit" class="nav-link btn btn-link text-dark">Click here to Logout</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@{
if (ViewData.TryGetValue("ParentLayout", out var parentLayout))
if (ViewData.TryGetValue("ParentLayout", out var parentLayout) && parentLayout != null)
{
Layout = (string)parentLayout;
Layout = parentLayout.ToString();
}
else
{
Expand Down

0 comments on commit 794b10f

Please sign in to comment.