windows: Skip AppendCategory call when there are no shell links (#37926)

`ICustomDestinationList::AppendCategory` rejects an empty `IObjectArray`
and returns an `E_INVALIDARG` error. Error propagated and caused an
early-return from `update_jump_list()`.
<img width="1628" height="540" alt="image"
src="https://github.com/user-attachments/assets/f8143297-c71e-42a1-a505-66cd77dfa599"
/>

Release Notes:

- N/A
This commit is contained in:
scuzqy 2025-11-05 02:48:18 +08:00 committed by GitHub
parent 4fd2b3f374
commit cdd7d4b2fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,7 +171,9 @@ fn add_recent_folders(
)?)?;
}
list.AppendCategory(&HSTRING::from("Recent Folders"), &tasks)?;
if tasks.GetCount().unwrap_or(0) > 0 {
list.AppendCategory(&HSTRING::from("Recent Folders"), &tasks)?;
}
Ok(())
}
}