Show a meaningful flash warning if trying to add/withdraw an amount of 0 instead of throwing an exception

Fixes issue #448
This commit is contained in:
Jan Böhmer 2023-12-07 00:36:16 +01:00
parent b5721dcfd0
commit ea9cc6723f
2 changed files with 51 additions and 39 deletions

View file

@ -414,6 +414,12 @@ class PartController extends AbstractController
throw new \LogicException("The timestamp must not be in the future!");
}
//Ensure that the amount is not null or negative
if ($amount <= 0) {
$this->addFlash('warning', 'part.withdraw.zero_amount');
goto err;
}
try {
switch ($action) {
case "withdraw":