Skip to content

Code Quality: Fixed Omnibar navigation in search results #17304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,13 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(

public async Task HandleItemNavigationAsync(string path)
{
if (ContentPageContext.ShellPage is null || PathComponents.LastOrDefault()?.Path is not { } currentPath)
if (ContentPageContext.ShellPage is null)
return;

var currentPath = PathComponents.LastOrDefault()?.Path;
var isFtp = FtpHelpers.IsFtpPath(path);
var normalizedInput = NormalizePathInput(path, isFtp);
if (currentPath.Equals(normalizedInput, StringComparison.OrdinalIgnoreCase) ||
if (currentPath is not null && currentPath.Equals(normalizedInput, StringComparison.OrdinalIgnoreCase) ||
string.IsNullOrWhiteSpace(normalizedInput))
return;

Expand Down Expand Up @@ -534,7 +535,7 @@ public async Task HandleItemNavigationAsync(string path)
else
{
normalizedInput = StorageFileExtensions.GetResolvedPath(normalizedInput, isFtp);
if (currentPath.Equals(normalizedInput, StringComparison.OrdinalIgnoreCase))
if (currentPath is not null && currentPath.Equals(normalizedInput, StringComparison.OrdinalIgnoreCase))
return;

var item = await FilesystemTasks.Wrap(() => DriveHelpers.GetRootFromPathAsync(normalizedInput));
Expand Down
Loading