Skip to content

Commit 6e2845b

Browse files
committed
fix: Fix condition for SingleSelectConstraint
1 parent d228c42 commit 6e2845b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/opnsense/mvc/app/models/OPNsense/Base/Constraints/SingleSelectConstraint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function validate($validator, $attribute): bool
5353
$Fields = array_unique(array_merge(array($nodeName), $this->getOptionValueList('addFields')));
5454
$countNotEmpty = 0;
5555
foreach ($Fields as $fieldname) {
56-
if (!is_null($parentNode->$fieldname) || !$parentNode->$fieldname->isEmpty()) {
56+
if (!is_null($parentNode->$fieldname) && !$parentNode->$fieldname->isEmpty()) {
5757
$countNotEmpty++;
5858
}
5959
}

0 commit comments

Comments
 (0)