Commit 1db4933c by Евгений

Division by zero

1 parent 4e1c013a
Showing with 1 additions and 1 deletions
......@@ -105,7 +105,7 @@ class Limits implements \App\Service\Contract\Limits {
function countObjectsLimitReserve(\App\Service\Contract\APIRequest $request, \App\Models\Limits $limit): int
{
$cost = $this->limitCosts->getCostObject($request);
return floor(($limit->spent - $this->limitCosts->getCostCall($request)) / $cost);
return $cost > 0 ? floor(($limit->spent - $this->limitCosts->getCostCall($request)) / $cost) : self::NAN;
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!