Ensure items is not null before checking its size so we dont crash (#19026)

Prevents a crash when no storage items are returned from a dropped path.

Terminal no longer crashes when a relative path is dragged and dropped
into the tool.

Closes #19015

(cherry picked from commit 7a9fb769558693d982660a88640bea7ba1bf7eb2)
Service-Card-Id: PVTI_lADOAF3p4s4Axadtzgd5l6I
Service-Version: 1.23
This commit is contained in:
James Pack 2025-06-12 20:34:51 -04:00 committed by Dustin L. Howett
parent eae5fbd83d
commit ee9198c9a3

View File

@ -3171,7 +3171,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
CATCH_LOG();
if (items.Size() > 0)
if (items && items.Size() > 0)
{
std::vector<std::wstring> fullPaths;