Skip to content

Commit fa9415b

Browse files
committed
Update decrement check
1 parent e596cde commit fa9415b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Database/Database.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5231,8 +5231,8 @@ public function decreaseDocumentAttribute(
52315231
* @var Document $attr
52325232
*/
52335233
$attr = \end($attr);
5234-
if (!in_array($attr->getAttribute('type'), $whiteList)) {
5235-
throw new TypeException('Attribute type must be one of: ' . \implode(',', $whiteList));
5234+
if (!\in_array($attr->getAttribute('type'), $whiteList) || $attr->getAttribute('array')) {
5235+
throw new TypeException('Attribute must be an integer or float and can not be an array.');
52365236
}
52375237

52385238
$document = $this->withTransaction(function () use ($collection, $id, $attribute, $value, $min) {

0 commit comments

Comments
 (0)