Fixed backend missing file issue
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -231,7 +231,7 @@ public class PetService {
|
||||
}
|
||||
try {
|
||||
catalogImageStorageService.deletePetImage(storedImagePath);
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException | IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public class ProductService {
|
||||
}
|
||||
try {
|
||||
catalogImageStorageService.deleteProductImage(storedImagePath);
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException | IllegalArgumentException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user