diff --git a/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/StampController.java b/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/StampController.java index 31afeba68..0df77bca7 100644 --- a/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/StampController.java +++ b/app/core/src/main/java/stirling/software/SPDF/controller/api/misc/StampController.java @@ -71,6 +71,9 @@ public class StampController { String stampText = request.getStampText(); MultipartFile stampImage = request.getStampImage(); if ("image".equalsIgnoreCase(stampType)) { + if (stampImage == null) { + throw new IllegalArgumentException("Stamp image file must be provided when stamp type is 'image'"); + } String stampImageName = stampImage.getOriginalFilename(); if (stampImageName == null || stampImageName.contains("..") || stampImageName.startsWith("/")) { throw new IllegalArgumentException("Invalid stamp image file path");