Skip to content

Commit a9136ac

Browse files
authored
Fixed an issue that would sometimes occur when moving tabs between windows (#2285)
1 parent f71c594 commit a9136ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Files/UserControls/SidebarControl.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private void NavigationViewItem_DragLeave(object sender, DragEventArgs e)
288288

289289
private async void NavigationViewLocationItem_DragOver(object sender, DragEventArgs e)
290290
{
291-
if (!((sender as Microsoft.UI.Xaml.Controls.NavigationViewItem).DataContext is LocationItem locationItem))
291+
if (!((sender as Microsoft.UI.Xaml.Controls.NavigationViewItem)?.DataContext is LocationItem locationItem))
292292
{
293293
return;
294294
}
@@ -324,7 +324,7 @@ private async void NavigationViewLocationItem_DragOver(object sender, DragEventA
324324

325325
deferral.Complete();
326326
}
327-
else if ((e.DataView.Properties["sourceLocationItem"] as Microsoft.UI.Xaml.Controls.NavigationViewItem).DataContext is LocationItem sourceLocationItem)
327+
else if ((e.DataView.Properties["sourceLocationItem"] as Microsoft.UI.Xaml.Controls.NavigationViewItem)?.DataContext is LocationItem sourceLocationItem)
328328
{
329329
// else if the drag over event is called over a location item
330330

Files/Views/ModernShellPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ private void NavigationToolbar_EditModeEnabled(object sender, EventArgs e)
520520
var mNavToolbar = NavigationToolbar as ModernNavigationToolbar;
521521
mNavToolbar.ManualEntryBoxLoaded = true;
522522
mNavToolbar.ClickablePathLoaded = false;
523-
mNavToolbar.PathText = string.IsNullOrEmpty(FilesystemViewModel.WorkingDirectory)
523+
mNavToolbar.PathText = string.IsNullOrEmpty(FilesystemViewModel?.WorkingDirectory)
524524
? AppSettings.HomePath
525525
: FilesystemViewModel.WorkingDirectory;
526526
}

0 commit comments

Comments
 (0)