diff --git a/Torch.Server/Views/ConfigControl.xaml.cs b/Torch.Server/Views/ConfigControl.xaml.cs index 1759ea3..fd1cb59 100644 --- a/Torch.Server/Views/ConfigControl.xaml.cs +++ b/Torch.Server/Views/ConfigControl.xaml.cs @@ -144,22 +144,17 @@ namespace Torch.Server.Views { //var w = new RoleEditor(_instanceManager.DedicatedConfig.SelectedWorld); //w.Show(); - var d = new RoleEditor(); var w = _instanceManager.DedicatedConfig.SelectedWorld; - if(w.Checkpoint.PromotedUsers == null) { - w.Checkpoint.PromotedUsers = new VRage.Serialization.SerializableDictionary(); - } - - if (w == null) + if (w is null) { MessageBox.Show("A world is not selected."); return; } - - if (w.Checkpoint.PromotedUsers == null) - w.Checkpoint.PromotedUsers = new SerializableDictionary(); - d.Edit(w.Checkpoint.PromotedUsers.Dictionary); + + w.Checkpoint.PromotedUsers ??= new(); + + new RoleEditor().Edit(w.Checkpoint.PromotedUsers.Dictionary); _instanceManager.DedicatedConfig.Administrators = w.Checkpoint.PromotedUsers.Dictionary.Where(k => k.Value >= MyPromoteLevel.Admin).Select(k => k.Key.ToString()).ToList(); } }