From 6c2edb8b84a74cd9d6d027bca6087d805c6be0ba Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Thu, 13 Oct 2022 11:12:02 -0500 Subject: [PATCH] OpenHere: stop failing if there's no site... --- src/cascadia/ShellExtension/OpenTerminalHere.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cascadia/ShellExtension/OpenTerminalHere.cpp b/src/cascadia/ShellExtension/OpenTerminalHere.cpp index d2320d24759..4aee550e5c8 100644 --- a/src/cascadia/ShellExtension/OpenTerminalHere.cpp +++ b/src/cascadia/ShellExtension/OpenTerminalHere.cpp @@ -156,6 +156,13 @@ IFACEMETHODIMP OpenTerminalHere::GetSite(REFIID riid, void** site) noexcept HRESULT OpenTerminalHere::GetLocationFromSite(IShellItem** location) const noexcept { + wil::assign_null_to_opt_param(location); + + if (!site_) + { + return S_FALSE; + } + wil::com_ptr_nothrow serviceProvider; RETURN_IF_FAILED(site_.query_to(serviceProvider.put())); wil::com_ptr_nothrow folderView;