Skip to content

Commit

Permalink
System.NullReferenceException: Object reference not set to an instanc…
Browse files Browse the repository at this point in the history
…e of an object.

   at MixItUp.Base.Util.ResetTrackerViewModel..ctor(ResetTracker model)
   at MixItUp.Base.ViewModel.Overlay.OverlayGoalV3ViewModel..ctor(OverlayGoalV3Model item)
   at MixItUp.Base.ViewModel.Overlay.OverlayWidgetV3ViewModel..ctor(OverlayWidgetV3Model widget)
   at MixItUp.WPF.Windows.Overlay.OverlayWidgetV3EditorWindow..ctor(OverlayWidgetV3Model item) in S:\Code\mixer-mixitup\MixItUp.WPF\Windows\Overlay\OverlayWidgetV3EditorWindow.xaml.cs:line 33
   at MixItUp.WPF.Controls.MainControls.OverlayWidgetsControl.EditButton_Click(Object sender, RoutedEventArgs e) in S:\Code\mixer-mixitup\MixItUp.WPF\Controls\MainControls\OverlayWidgetsControl.xaml.cs:line 75
  • Loading branch information
Matthew Olivo committed Sep 29, 2024
1 parent ea42dd0 commit f119994
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions MixItUp.Base/Model/Overlay/OverlayGoalV3Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ public override async Task Initialize()
{
await base.Initialize();

if (this.ResetTracker == null)
{
this.ResetTracker = new ResetTracker();
}

CounterModel.OnCounterUpdated -= CounterModel_OnCounterUpdated;
if (this.GoalType == OverlayGoalV3Type.Counter && ChannelSession.Settings.Counters.TryGetValue(this.CounterName, out CounterModel counter))
{
Expand Down
2 changes: 1 addition & 1 deletion MixItUp.Base/Util/ResetTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public ResetTrackerViewModel()

public ResetTrackerViewModel(ResetTracker model)
{
this.Model = model;
this.Model = model ?? new ResetTracker();
this.Model.UpgradeToNewerFormat();
}

Expand Down

0 comments on commit f119994

Please sign in to comment.