Skip to content

Commit

Permalink
Merge pull request #665 from DemoJameson/fix-crash-when-settings-corr…
Browse files Browse the repository at this point in the history
…upted
  • Loading branch information
microlith57 authored Oct 16, 2023
2 parents fcb4c81 + 9b1acde commit ff3b832
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Celeste.Mod.mm/Mod/Core/CoreModuleSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,13 @@ public string CurrentBranch {
set => _CurrentBranch = value is "dev" or "beta" or "stable" ? "updater_src_" + value : value; // branch names were changed at some point
}

private Dictionary<string, LogLevel> _LogLevels = new Dictionary<string, LogLevel>();

[SettingIgnore]
public Dictionary<string, LogLevel> LogLevels { get; set; } = new Dictionary<string, LogLevel>();
public Dictionary<string, LogLevel> LogLevels {
get => _LogLevels;
set => _LogLevels = value ?? new Dictionary<string, LogLevel>();
}

[SettingSubHeader("MODOPTIONS_COREMODULE_MENUNAV_SUBHEADER")]
[SettingInGame(false)]
Expand Down
6 changes: 3 additions & 3 deletions Celeste.Mod.mm/Mod/Everest/ButtonBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ public class ButtonBinding {

public List<Buttons> Buttons {
get => Binding.Controller;
set => Binding.Controller = value;
set => Binding.Controller = value ?? new List<Buttons>();
}

public List<Keys> Keys {
get => Binding.Keyboard;
set => Binding.Keyboard = value;
set => Binding.Keyboard = value ?? new List<Keys>();
}

public List<patch_MInput.patch_MouseData.MouseButtons> MouseButtons {
get => ((patch_Binding) Binding).Mouse;
set => ((patch_Binding) Binding).Mouse = value;
set => ((patch_Binding) Binding).Mouse = value ?? new List<patch_MInput.patch_MouseData.MouseButtons>();
}

private Binding _Binding;
Expand Down

0 comments on commit ff3b832

Please sign in to comment.