Fix bug in avatar upload

This commit is contained in:
grimsi
2025-03-30 12:32:40 +02:00
parent 17d3211d22
commit 1c1a203ebd
@@ -53,7 +53,7 @@ class ImageEndpoint(
fun uploadAvatar(@RequestParam("file") file: MultipartFile) {
val auth: Authentication = SecurityContextHolder.getContext().authentication
val image: Image = if (userService.hasAvatar(auth.name)) {
val image: Image = if (!userService.hasAvatar(auth.name)) {
imageService.createFile(ImageType.AVATAR, file.inputStream, file.contentType!!)
} else {
val existingAvatar = userService.getAvatar(auth.name)!!