mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 12:42:54 +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)
|
public static ColourInfo FromStreamName(string name)
|
||||||
{
|
{
|
||||||
|
if (!string.IsNullOrEmpty(name))
|
||||||
if (colours.TryGetValue(name, out ColourInfo colour))
|
if (colours.TryGetValue(name, out ColourInfo colour))
|
||||||
return colour;
|
return colour;
|
||||||
else return new Color4(255, 255, 255, 255);
|
return new Color4(255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user