handle cases where user doesn't exit/doesn't have a profile pic
This commit is contained in:
		
							parent
							
								
									5986083c3d
								
							
						
					
					
						commit
						ba9b1439b5
					
				| @ -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; | ||||
|     } | ||||
|  | ||||
| Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 452 KiB | 
		Loading…
	
		Reference in New Issue
	
	Block a user