From 0a67e5a274676b0bbb7146ce9c4b1fda24ec7c49 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 9 Jul 2018 17:09:17 +0900 Subject: [PATCH] Fix some possible null reference exceptions --- osu.Game/Screens/Select/Leaderboards/DrawableRank.cs | 4 +++- osu.Game/Users/Country.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs index 2a11bf8346..228633a41f 100644 --- a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs +++ b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs @@ -46,7 +46,9 @@ namespace osu.Game.Screens.Select.Leaderboards public void UpdateRank(ScoreRank newRank) { Rank = newRank; - updateTexture(); + + if (IsLoaded) + updateTexture(); } } } diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index c9b577a62f..98b3a2df0c 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.cs @@ -42,7 +42,9 @@ namespace osu.Game.Users return; country = value; - sprite.Texture = getFlagTexture(); + + if (IsLoaded) + sprite.Texture = getFlagTexture(); } }