From f49837e5feafa4f77efa050d5ccd0ce4976683c8 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 9 Apr 2026 15:08:46 +0100 Subject: [PATCH] Fix division by zero? --- app/Models/Consumable.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/Consumable.php b/app/Models/Consumable.php index 39892ac4e3..d94c3d4dbc 100644 --- a/app/Models/Consumable.php +++ b/app/Models/Consumable.php @@ -170,6 +170,10 @@ class Consumable extends SnipeModel return 100; } + if ($this->qty == '') { + return 1; + } + return ($this->qty - $this->consumables_users_count) / $this->qty * 100; }