Skip to content

Commit

Permalink
Fix assert hitting Ctrl-Y when redo is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescan committed Nov 21, 2024
1 parent 3eefdf5 commit a73848b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Src/TacentView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,9 @@ void Viewer::OnUndo()

void Viewer::OnRedo()
{
tAssert(CurrImage && CurrImage->IsRedoAvailable());
if (!CurrImage || !CurrImage->IsRedoAvailable())
return;

CurrImage->Unbind();
CurrImage->Redo();
CurrImage->Bind();
Expand Down Expand Up @@ -3840,7 +3842,6 @@ void Viewer::KeyCallback(GLFWwindow* window, int key, int scancode, int action,
Config::ProfileData& profile = Config::GetProfileData();
uint32 viewerModifiers = Bindings::TranslateModifiers(modifiers);
Bindings::Operation operation = profile.InputBindings.GetOperation(key, viewerModifiers);
bool imgAvail = CurrImage && CurrImage->IsLoaded();
switch (operation)
{
case Bindings::Operation::NextImage: OnNextImage(true); break;
Expand Down

0 comments on commit a73848b

Please sign in to comment.