Skip to content

Commit

Permalink
Prevent issue on business rules execution in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Feb 26, 2025
1 parent be15664 commit e52fe23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Inventory/Asset/NetworkPort.php
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ public function rulepassed($items_id, $itemtype, $rules_id, $ports_id = [])
$item = new $itemtype();

if ($items_id == "0") {
//not yet existing, create
$item->getEmpty();
//not yet existing, create
$input = (array)$port;
if (property_exists($port, 'mac') && (!property_exists($port, 'name') || empty($port->name) || is_numeric($port->name) || preg_match('@([\w-]+)?(\d+)/\d+(/\d+)?@', $port->name))) {
if ($name = $this->getNameForMac($port->mac)) {
Expand Down

0 comments on commit e52fe23

Please sign in to comment.