Avoid null references on game edit/add page
parent
5b7bd5140c
commit
285cb07e37
|
@ -60,6 +60,9 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Game.Actions == null)
|
||||
Game.Actions = new List<Data.Models.Action>();
|
||||
|
||||
OrderedActions = Game.Actions.OrderBy(a => a.SortOrder).ToList();
|
||||
FixSortOrder();
|
||||
}
|
||||
|
|
|
@ -99,6 +99,9 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Game.Archives == null)
|
||||
Game.Archives = new List<Archive>();
|
||||
|
||||
HttpClient.BaseAddress = new Uri(Navigator.BaseUri);
|
||||
|
||||
Archive = new Archive()
|
||||
|
|
|
@ -78,6 +78,9 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Game.Keys == null)
|
||||
Game.Keys = new List<Key>();
|
||||
|
||||
AllocatedKeys = Game.Keys.Count(k => k.IsAllocated());
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,12 @@
|
|||
@code {
|
||||
[Parameter] public Game Game { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Game.MultiplayerModes == null)
|
||||
Game.MultiplayerModes = new List<MultiplayerMode>();
|
||||
}
|
||||
|
||||
private void AddMode()
|
||||
{
|
||||
if (Game.MultiplayerModes == null)
|
||||
|
|
|
@ -110,6 +110,9 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Game.Scripts == null)
|
||||
Game.Scripts = new List<Script>();
|
||||
|
||||
Snippets = ScriptService.GetSnippets();
|
||||
|
||||
if (Script == null)
|
||||
|
|
Loading…
Reference in New Issue