diff --git a/Controllers/UserController.php b/Controllers/UserController.php index cb34160..8a08beb 100644 --- a/Controllers/UserController.php +++ b/Controllers/UserController.php @@ -188,9 +188,17 @@ final class UserController $O_userModel = new UserModel(); $A_user = $O_userModel->getUserByID($A_urlParams[0]); - header("Content-Type: image/png"); + if (!isset($A_user)) { + die(); + } + + header("Content-Type: image/png"); + if ($A_user["PROFILE_PIC"] === null) { + echo file_get_contents(Constants::rootDir()."/static/img/generic_user.jpg"); + } else { + echo $A_user["PROFILE_PIC"]; + } - echo $A_user["PROFILE_PIC"]; return Utils::RETURN_RAW; } diff --git a/static/img/users/1.jpg b/static/img/generic_user.jpg similarity index 100% rename from static/img/users/1.jpg rename to static/img/generic_user.jpg