Skip to content

Commit 7893260

Browse files
Merge pull request #4850 from LibreSign/fix/prevent-json-decode-null
fix: prevent json decode null
2 parents f2980d4 + 28de6a3 commit 7893260

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/Db/IdentifyMethodMapper.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public function neutralizeDeletedUser(string $userId, string $displayName): void
5757
->andWhere($qb->expr()->eq('im.identifier_value', $qb->createNamedParameter($userId)));
5858
$cursor = $qb->executeQuery();
5959
while ($row = $cursor->fetch()) {
60-
$row['metadata'] = json_decode($row['metadata'], true);
60+
if (is_string($row['metadata']) && !empty($row['metadata'])) {
61+
$row['metadata'] = json_decode($row['metadata'], true);
62+
} else {
63+
$row['metadata'] = [];
64+
}
6165
$row['metadata']['deleted_account'] = [
6266
'account' => $userId,
6367
'display_name' => $displayName,

0 commit comments

Comments
 (0)