Skip to content

Commit 2f148bd

Browse files
committed
Suppressing null reference exception warning
1 parent bd0dab8 commit 2f148bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/SampleApplication/Views/Home/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<li>
1616
Environment Variables:
1717
<ul>
18-
@foreach (var key in ((System.Collections.IDictionary)ViewData["Environment"]).Keys)
18+
@foreach (var key in ((System.Collections.IDictionary)ViewData["Environment"])!.Keys)
1919
{
2020
<li>@key = @(((System.Collections.IDictionary)ViewData["Environment"])[key])</li>
2121
}

src/SampleApplication/Views/Home/Memory.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<h2>Services</h2>
1515
<ul>
16-
@foreach (var key in ((System.Collections.IDictionary)ViewData["ServiceReferences"]).Keys)
16+
@foreach (var key in ((System.Collections.IDictionary)ViewData["ServiceReferences"])!.Keys)
1717
{
1818
<li>@key = @(((System.Collections.IDictionary)ViewData["ServiceReferences"])[key])</li>
1919
}

0 commit comments

Comments
 (0)