Skip to content

Commit f45eb0d

Browse files
committed
Dont log failures to get font title info
1 parent de8c0f3 commit f45eb0d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/AppInstallerCommonCore/Fonts.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ namespace AppInstaller::Fonts
3434
// This code can fail in a number of ways, including if the file isn't actually
3535
// a font file or does not have a title.
3636
wil::com_ptr<IPropertyStore> pPropertyStore;
37-
THROW_IF_FAILED(SHGetPropertyStoreFromParsingName(fontFilePath.c_str(), nullptr, GPS_DEFAULT, IID_PPV_ARGS(&pPropertyStore)));
37+
if (FAILED(SHGetPropertyStoreFromParsingName(fontFilePath.c_str(), nullptr, GPS_DEFAULT, IID_PPV_ARGS(&pPropertyStore))))
38+
{
39+
// Intentionally not throwing here as this is an expected failure case for non-font files or files without titles.
40+
return {};
41+
}
42+
3843
PROPVARIANT prop;
3944
PropVariantInit(&prop);
4045
THROW_IF_FAILED(pPropertyStore->GetValue(PKEY_Title, &prop));

0 commit comments

Comments
 (0)