N°931 Fix bug when max allowed items set to 1

This commit is contained in:
Molkobain
2018-12-14 11:11:59 +01:00
parent b4448c5bb9
commit 9b5d8b8a01
2 changed files with 8 additions and 1 deletions

View File

@@ -264,7 +264,7 @@ class ormSet
*/
public function Add($oItem)
{
if (($this->iLimit != 0) && ($this->Count() === $this->iLimit))
if (($this->iLimit != 0) && ($this->Count() > $this->iLimit))
{
throw new CoreException("Maximum number of items ({$this->iLimit}) reached for {$this->sClass}:{$this->sAttCode}");
}