feat: have sql_get_actor return null when no actor is found

This commit is contained in:
Nat 2024-09-01 14:54:35 -07:00
parent c6f9f74be3
commit 9e7c18afba
1 changed files with 4 additions and 1 deletions

View File

@ -19,5 +19,8 @@ function sql_fetch_actor($conn, string $preferred_username) {
array(':object_id' => $object_id)
);
return $result->fetchArray(SQLITE3_ASSOC);
// fetchArray returns false when there's no array; we're rather have it be
// explicitly null
$actor = $result->fetchArray(SQLITE3_ASSOC);
return $actor !== false ? $actor : null;
}