Skip to content

Commit

Permalink
Fix aborting creation of new category
Browse files Browse the repository at this point in the history
When you enter a new category while creating a transaction, the
category got created even when you click "Cancel" in the alert
asking for the type (income or expenses).

A variable was accidentally shadowed and thus sabotaged the return
value.
  • Loading branch information
humdingerb committed Nov 20, 2024
1 parent 6ddbb77 commit 931cd63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CategoryBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ CategoryBox::Validate()

SetText(category);
bool success = _SetTypeFromCategory(category);

return success;
}

Expand Down Expand Up @@ -155,7 +156,7 @@ CategoryBox::_SetTypeFromCategory(BString category)
&& category.ICompare(B_TRANSLATE_ALL(
"Split", "CommonTerms", "The noun 'split', as in 'a split-category'"))
!= 0) {
bool success = _AddNewCategory(category);
success = _AddNewCategory(category);
}

return success;
Expand Down

0 comments on commit 931cd63

Please sign in to comment.