1
0
Fork 0
mirror of synced 2024-10-03 02:37:40 +13:00

Make sure target exists before updating

This commit is contained in:
Jake Barnby 2024-01-19 20:18:10 +13:00
parent a970018b04
commit 8fd5a336af
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -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) {