fix: [Object:DeltaMerge] Gracefully catch if *_seen field is not present

in the pushed Object
pull/5462/head
mokaddem 2019-12-16 15:00:30 +01:00
parent a2127bea83
commit aabc568b90
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 0 deletions

View File

@ -545,6 +545,12 @@ class MispObject extends AppModel
$tmpfile->delete();
$tmpfile->close();
}
if (!isset($attributes['Attribute'][$k]['first_seen'])) {
$attributes['Attribute'][$k]['first_seen'] = null;
}
if (!isset($attributes['Attribute'][$k]['last_seen'])) {
$attributes['Attribute'][$k]['last_seen'] = null;
}
unset($attributes['Attribute'][$k]['save']);
}
return $attributes;