mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Handle possible null reference;
This commit is contained in:
parent
78f0f37ee6
commit
22af3cd923
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user