Font::findFonts() crash

Seems like same issue, but it still happens.
My app and FontsDemo crash on my machine.
Maybe it happens only for my machine(mysterious enough, Windows sometimes badly treat font data), but those who use Font::findFonts() also suffer this problem, because it can be happen in the end-user machine.

What happened:
dwFont in Font::findAllTypefaceStyles() is nullptr although the program expects not to be. So read access violation happens at calling GetSimulations()

// Ignore any algorithmically generated bold and oblique styles..
if (dwFont->GetSimulations() == DWRITE_FONT_SIMULATIONS_NONE)
     results.addIfNotAlreadyThere (getFontFaceName (dwFont));

My suggestion is, how about adding null check?

// Ignore any algorithmically generated bold and oblique styles..
if (dwFont != nullptr)
    if (dwFont->GetSimulations() == DWRITE_FONT_SIMULATIONS_NONE)
         results.addIfNotAlreadyThere (getFontFaceName (dwFont));

I don’t know why dwFont suddenly becomes nullptr, but by adding null check, it works fine anyway.
(by the way, family was “Cascadia Code”)

Additional information.
According to my debugger, fontFamily->GetFont(...) from Font::findAllTypefaceStyles() returns

DWRITE_E_FILEACCESS
0x88985004
A font file exists but could not be opened due to access denied, sharing violation, or similar error.

when it crashes.
I don’t know why this error happens, but proper error handling would be

if (SUCCEEDED(hr))
   if (dwFont->GetSimulations() == DWRITE_FONT_SIMULATIONS_NONE)
      results.addIfNotAlreadyThere (getFontFaceName (dwFont));

Which target platform? On iOS, if you don’t have file permissions (sandbox), you will trigger a crash any time file access is performed outside of the currently allowable tree…

Hi, as linked issue and subcategory mentioned, Windows only.
Forgot to mention in the body sentense! thanks.