diff --git a/public/api/v1/database.php b/public/api/v1/database.php index c579daf..0c34489 100644 --- a/public/api/v1/database.php +++ b/public/api/v1/database.php @@ -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; }