@@ -121,7 +121,7 @@ public async Task Menu_Invoke_ReturnsNavigationViewModel() {
121121
122122 var result = await viewComponent . InvokeAsync ( ) . ConfigureAwait ( false ) ;
123123 var concreteResult = result as ViewViewComponentResult ;
124- var model = concreteResult ? . ViewData . Model as NavigationViewModel < NavigationTopicViewModel > ;
124+ var model = concreteResult ? . ViewData ? . Model as NavigationViewModel < NavigationTopicViewModel > ;
125125
126126 Assert . NotNull ( model ) ;
127127 Assert . Equal ( _topic . GetWebPath ( ) , model ? . CurrentWebPath ) ;
@@ -147,7 +147,7 @@ public async Task Menu_Invoke_ReturnsConfiguredNavigationRoot() {
147147
148148 var result = await viewComponent . InvokeAsync ( ) . ConfigureAwait ( false ) ;
149149 var concreteResult = result as ViewViewComponentResult ;
150- var model = concreteResult ? . ViewData . Model as NavigationViewModel < NavigationTopicViewModel > ;
150+ var model = concreteResult ? . ViewData ? . Model as NavigationViewModel < NavigationTopicViewModel > ;
151151
152152 Assert . NotNull ( model ) ;
153153 Assert . Equal ( webPath , model ? . CurrentWebPath ) ;
@@ -194,7 +194,7 @@ public async Task PageLevelNavigation_Invoke_ReturnsNavigationViewModel() {
194194
195195 var result = await viewComponent . InvokeAsync ( ) . ConfigureAwait ( false ) ;
196196 var concreteResult = result as ViewViewComponentResult ;
197- var model = concreteResult ? . ViewData . Model as NavigationViewModel < NavigationTopicViewModel > ;
197+ var model = concreteResult ? . ViewData ? . Model as NavigationViewModel < NavigationTopicViewModel > ;
198198
199199 Assert . NotNull ( model ) ;
200200 Assert . Equal ( _topic . GetWebPath ( ) , model ? . CurrentWebPath ) ;
@@ -222,7 +222,7 @@ public async Task PageLevelNavigation_Invoke_ReturnsNull() {
222222
223223 var result = await viewComponent . InvokeAsync ( ) . ConfigureAwait ( false ) ;
224224 var concreteResult = result as ViewViewComponentResult ;
225- var model = concreteResult ? . ViewData . Model as NavigationViewModel < NavigationTopicViewModel > ;
225+ var model = concreteResult ? . ViewData ? . Model as NavigationViewModel < NavigationTopicViewModel > ;
226226
227227 Assert . NotNull ( model ) ;
228228 Assert . Equal ( webPath , model ? . CurrentWebPath ) ;
@@ -250,7 +250,7 @@ public async Task PageLevelNavigation_InvokeWithNullTopic_ReturnsNull()
250250
251251 var result = await viewComponent . InvokeAsync ( ) . ConfigureAwait ( false ) ;
252252 var concreteResult = result as ViewViewComponentResult ;
253- var model = concreteResult ? . ViewData . Model as NavigationViewModel < NavigationTopicViewModel > ;
253+ var model = concreteResult ? . ViewData ? . Model as NavigationViewModel < NavigationTopicViewModel > ;
254254
255255 Assert . NotNull ( model ) ;
256256 Assert . Equal ( String . Empty , model ? . CurrentWebPath ) ;
0 commit comments