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