From d7b44f41bdd8d736e113fa4db3e59c0f785ed815 Mon Sep 17 00:00:00 2001 From: mjokfox Date: Tue, 31 Dec 2024 20:07:34 +0100 Subject: [PATCH] nullcheck from user_config might be handy --- core/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/user.php b/core/user.php index d1985c648..494b9930e 100644 --- a/core/user.php +++ b/core/user.php @@ -259,7 +259,7 @@ public function get_avatar_post_link() : ?string { global $database; $user_config = new DatabaseConfig($database, "user_config", "user_id", (string)$this->id); $id = $user_config->get_int("avatar_post_id"); - if ($id === 0) { + if (is_null($id) || $id === 0) { return null; } $image = Image::by_id($id);