Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit dc9d5fa

Browse files
remove Null Forgiving Operator
1 parent d275087 commit dc9d5fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/iOS/PopupRenderer.ios.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ void CreateControl()
140140
void SetViewController()
141141
{
142142
IVisualElementRenderer currentPageRenderer;
143-
var modalStackCount = Application.Current.MainPage?.Navigation?.ModalStack?.Count ?? 0;
144143
var page = Application.Current.MainPage;
144+
var modalStackCount = page?.Navigation?.ModalStack?.Count ?? 0;
145145
if (modalStackCount > 0)
146146
{
147147
var index = modalStackCount - 1;
148-
page = page!.Navigation!.ModalStack![index];
148+
page = page?.Navigation.ModalStack[index];
149149
currentPageRenderer = Platform.GetRenderer(page);
150150
}
151151
else
@@ -155,7 +155,7 @@ void SetViewController()
155155

156156
if (currentPageRenderer == null)
157157
{
158-
ViewController ??= page.CreateViewController();
158+
ViewController ??= page?.CreateViewController();
159159
}
160160
else
161161
{

0 commit comments

Comments
 (0)