fix nullable for TeamList

This commit is contained in:
cdwcgt 2023-07-30 01:49:57 +09:00
parent cb4adf115c
commit 9482f74456
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2
1 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ public partial class DrawingsScreen : TournamentScreen
private Storage storage = null!;
public ITeamList? TeamList;
public ITeamList TeamList = null!;
[BackgroundDependencyLoader]
private void load(Storage storage)
@ -48,7 +48,8 @@ private void load(Storage storage)
RelativeSizeAxes = Axes.Both;
TeamList ??= new StorageBackedTeamList(storage);
if (TeamList.IsNull())
TeamList = new StorageBackedTeamList(storage);
if (!TeamList.Teams.Any())
{
@ -223,7 +224,7 @@ private void reloadTeams()
teamsContainer.ClearTeams();
allTeams.Clear();
foreach (TournamentTeam t in TeamList.AsNonNull().Teams)
foreach (TournamentTeam t in TeamList.Teams)
{
if (groupsContainer.ContainsTeam(t.FullName.Value))
continue;