Only operate on non-empty input
This commit is contained in:
parent
b950364606
commit
329d9a1c90
@ -35,22 +35,23 @@ class XMLValidator extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
|
|
||||||
try {
|
if (input)
|
||||||
// Overwrite error handler since the built-in one does not raise exceptions.
|
try {
|
||||||
(new DOMParser.DOMParser({errorHandler: {
|
// Overwrite error handler since the built-in one does not raise exceptions.
|
||||||
warning: (msg) => {
|
(new DOMParser.DOMParser({errorHandler: {
|
||||||
throw new OperationError(msg);
|
warning: (msg) => {
|
||||||
},
|
throw new OperationError(msg);
|
||||||
error: (msg) => {
|
},
|
||||||
throw new OperationError(msg);
|
error: (msg) => {
|
||||||
},
|
throw new OperationError(msg);
|
||||||
fatalError: (msg) => {
|
},
|
||||||
throw new OperationError(msg);
|
fatalError: (msg) => {
|
||||||
},
|
throw new OperationError(msg);
|
||||||
}})).parseFromString(input);
|
},
|
||||||
} catch (err) {
|
}})).parseFromString(input);
|
||||||
throw new OperationError(err);
|
} catch (err) {
|
||||||
}
|
throw new OperationError(err);
|
||||||
|
}
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user