1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

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

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 @@ namespace osu.Game.Skinning
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;