mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-23 23:57:41 +01:00
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:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user