mirror of https://github.com/MISP/MISP
fix: [internal] When capturing an object, avoid throwig notice errors if no attributes are set, fixes #5439
parent
ff333ccb85
commit
bed34757f8
|
@ -597,8 +597,10 @@ class MispObject extends AppModel
|
|||
$this->Event->unpublishEvent($eventId);
|
||||
$objectId = $this->id;
|
||||
$partialFails = array();
|
||||
foreach ($object['Object']['Attribute'] as $attribute) {
|
||||
$this->Attribute->captureAttribute($attribute, $eventId, $user, $objectId, $log);
|
||||
if (!empty($object['Object']['Attribute'])) {
|
||||
foreach ($object['Object']['Attribute'] as $attribute) {
|
||||
$this->Attribute->captureAttribute($attribute, $eventId, $user, $objectId, $log);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue