1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:43:21 +08:00

Handle possible null reference;

This commit is contained in:
HoutarouOreki 2018-07-21 09:37:58 +02:00
parent 78f0f37ee6
commit 22af3cd923

View File

@ -28,9 +28,10 @@ namespace osu.Game.Graphics
public static ColourInfo FromStreamName(string name)
{
if (colours.TryGetValue(name, out ColourInfo colour))
return colour;
else return new Color4(255, 255, 255, 255);
if (!string.IsNullOrEmpty(name))
if (colours.TryGetValue(name, out ColourInfo colour))
return colour;
return new Color4(255, 255, 255, 255);
}
}
}