Fixed backend missing file issue

This commit is contained in:
Alex
2026-04-07 00:10:42 -06:00
parent 870920f67e
commit 5a1ff67db4
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()) { if (user.getAvatarUrl() == null || user.getAvatarUrl().isBlank()) {
return; return;
} }
try {
Files.deleteIfExists(resolveStoredAvatarPath(user.getAvatarUrl())); Files.deleteIfExists(resolveStoredAvatarPath(user.getAvatarUrl()));
} catch (IllegalArgumentException ignored) {
}
} }
public String toOwnerAvatarUrl(User user) { public String toOwnerAvatarUrl(User user) {

View File

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

View File

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