Skip to content

Commit

Permalink
Update RealtimeEffectStateUI.cpp
Browse files Browse the repository at this point in the history
Add null check before calling MarkUnsaved on project.
  • Loading branch information
JoeS209 authored and LWinterberg committed Jan 23, 2024
1 parent b4949ec commit cf6a2ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/effects/RealtimeEffectStateUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ void RealtimeEffectStateUI::Show(AudacityProject& project)
});

mParameterChangedSubscription = mEffectUIHost->GetEditor()->Subscribe(
[this](auto) { UndoManager::Get(*mpProject).MarkUnsaved(); });
[this](auto) { if (mpProject) { // This can be null if closing an effect without making changes.
UndoManager::Get(*mpProject).MarkUnsaved();
}
});
}

void RealtimeEffectStateUI::Hide(AudacityProject* project)
Expand Down

0 comments on commit cf6a2ae

Please sign in to comment.