Add blocksize validation in XORChecksum run method
Added validation check for blocksize parameter in run method.
This commit is contained in:
parent
55d0bbc90f
commit
fcceb72e9d
@ -43,7 +43,7 @@ class XORChecksum extends Operation {
|
||||
run(input, args) {
|
||||
const blocksize = args[0];
|
||||
|
||||
// 2. Added validation check
|
||||
|
||||
if (!Number.isInteger(blocksize) || blocksize <= 0) {
|
||||
throw new OperationError("Blocksize must be a positive integer.");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user