ADD extra error checking

This commit is contained in:
2025-06-05 20:30:22 +02:00
parent 7f829a70e1
commit 9d2830302b

View File

@@ -37,6 +37,9 @@ public class EditService {
Float start = videoMetadata.getStartPoint(); Float start = videoMetadata.getStartPoint();
Float end = videoMetadata.getEndPoint(); Float end = videoMetadata.getEndPoint();
Float fileSize = videoMetadata.getFileSize(); Float fileSize = videoMetadata.getFileSize();
Integer width = videoMetadata.getWidth();
Integer height = videoMetadata.getHeight();
Float fps = videoMetadata.getFps();
if (start != null && start < 0) { if (start != null && start < 0) {
throw new IllegalArgumentException("Start point cannot be negative"); throw new IllegalArgumentException("Start point cannot be negative");
@@ -53,5 +56,17 @@ public class EditService {
if (fileSize != null && fileSize < 100) { if (fileSize != null && fileSize < 100) {
throw new IllegalArgumentException("File size cannot be less than 100kb"); throw new IllegalArgumentException("File size cannot be less than 100kb");
} }
if (width != null && width < 1) {
throw new IllegalArgumentException("Width cannot be less than 1");
}
if (height != null && height < 1) {
throw new IllegalArgumentException("Height cannot be less than 1");
}
if (fps != null && fps < 1) {
throw new IllegalArgumentException("FPS cannot be less than 1");
}
} }
} }