File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ public async Task ExecuteAsync()
37
37
if ( provider is null )
38
38
return ;
39
39
40
- await provider . TogglePreviewPopupAsync ( context . SelectedItem ! . ItemPath ) ;
40
+ var itemPath = context . SelectedItem ? . ItemPath ;
41
+ if ( itemPath is not null )
42
+ await provider . TogglePreviewPopupAsync ( itemPath ) ;
41
43
}
42
44
43
45
private async Task SwitchPopupPreviewAsync ( )
@@ -48,17 +50,19 @@ private async Task SwitchPopupPreviewAsync()
48
50
if ( provider is null )
49
51
return ;
50
52
51
- await provider . SwitchPreviewAsync ( context . SelectedItem ! . ItemPath ) ;
53
+ var itemPath = context . SelectedItem ? . ItemPath ;
54
+ if ( itemPath is not null )
55
+ await provider . SwitchPreviewAsync ( itemPath ) ;
52
56
}
53
57
}
54
58
55
- public void Context_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
59
+ public async void Context_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
56
60
{
57
61
switch ( e . PropertyName )
58
62
{
59
63
case nameof ( IContentPageContext . SelectedItems ) :
60
64
OnPropertyChanged ( nameof ( IsExecutable ) ) ;
61
- var _ = SwitchPopupPreviewAsync ( ) ;
65
+ await SwitchPopupPreviewAsync ( ) ;
62
66
break ;
63
67
}
64
68
}
You can’t perform that action at this time.
0 commit comments