Skip to content

Commit

Permalink
Stop throwing exceptions for FontIcons (#13858)
Browse files Browse the repository at this point in the history
While having a debugger attached, opening the settings tab generates an
uncomfortable amount of exceptions. This change reduces this by a lot.

## Validation Steps Performed
* Icons still appear ✅
  • Loading branch information
lhecker authored Aug 29, 2022
1 parent 0ca1356 commit 76a5ff1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cascadia/TerminalSettingsModel/IconPathConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
template<typename TIconSource>
TIconSource _getColoredBitmapIcon(const winrt::hstring& path)
{
if (!path.empty())
// FontIcon uses glyphs in the private use area, whereas valid URIs only contain ASCII characters.
// To skip throwing on Uri construction, we can quickly check if the first character is ASCII.
if (!path.empty() && path.front() < 128)
{
try
{
Expand Down

0 comments on commit 76a5ff1

Please sign in to comment.