Skip to content

Commit 779b54c

Browse files
committed
- Fixed deallocation issue
1 parent 4103d8e commit 779b54c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to `laravel-licenser` will be documented in this file.
44

5+
### 4.0.1
6+
- Fixed deallocation issue
7+
58
### 4.0.0
69
- Deallocation logic
710

src/License.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ public function allocate($quantity, $add = false)
104104
public function deallocate($quantity, $sub = false)
105105
{
106106
$used = $this->used();
107-
if ($used - $quantity >= 0) {
108-
if(!$sub) {
109-
$this->error($this->deallocateMessage($used, $quantity));
110-
} else {
111-
$this->sub($quantity);
112-
}
107+
if ($used - $quantity >= 0 && $sub) {
108+
$this->sub($quantity);
113109
}
114110

115111
$this->deallocateSuccess($quantity);

0 commit comments

Comments
 (0)