Make sure target exists before updating
This commit is contained in:
parent
a970018b04
commit
8fd5a336af
1 changed files with 7 additions and 5 deletions
|
@ -247,11 +247,13 @@ class Messaging extends Action
|
|||
Query::equal('identifier', [$detail['recipient']])
|
||||
]);
|
||||
|
||||
$dbForProject->updateDocument(
|
||||
'targets',
|
||||
$target->getId(),
|
||||
$target->setAttribute('expired', true)
|
||||
);
|
||||
if ($target instanceof Document && !$target->isEmpty()) {
|
||||
$dbForProject->updateDocument(
|
||||
'targets',
|
||||
$target->getId(),
|
||||
$target->setAttribute('expired', true)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
|
Loading…
Reference in a new issue