Fixed backend missing file issue

This commit is contained in:
Alex
2026-04-07 00:10:42 -06:00
parent 2b097cf4a9
commit 12c7384951
3 changed files with 6 additions and 3 deletions

View File

@@ -48,7 +48,10 @@ public class AvatarStorageService {
if (user.getAvatarUrl() == null || user.getAvatarUrl().isBlank()) {
return;
}
Files.deleteIfExists(resolveStoredAvatarPath(user.getAvatarUrl()));
try {
Files.deleteIfExists(resolveStoredAvatarPath(user.getAvatarUrl()));
} catch (IllegalArgumentException ignored) {
}
}
public String toOwnerAvatarUrl(User user) {

View File

@@ -231,7 +231,7 @@ public class PetService {
}
try {
catalogImageStorageService.deletePetImage(storedImagePath);
} catch (IOException ignored) {
} catch (IOException | IllegalArgumentException ignored) {
}
}

View File

@@ -143,7 +143,7 @@ public class ProductService {
}
try {
catalogImageStorageService.deleteProductImage(storedImagePath);
} catch (IOException ignored) {
} catch (IOException | IllegalArgumentException ignored) {
}
}