Return null on font lookup failure instead of asserting

Fallback weirdness.
This commit is contained in:
Dean Herbert 2024-01-07 19:49:42 +09:00
parent 16ea7f9b77
commit dc31c66f62
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
@ -74,7 +73,8 @@ public LegacyGlyphStore(string fontName, ISkin skin, Vector2? maxSize)
public ITexturedCharacterGlyph? Get(string? fontName, char character)
{
// We only service one font.
Debug.Assert(fontName == this.fontName);
if (fontName != this.fontName)
return null;
if (cache.TryGetValue(character, out var cached))
return cached;