mirror of
https://github.com/gchq/CyberChef.git
synced 2024-09-29 23:11:30 +02:00
Added more error-handling to ToUpperCase()
This commit is contained in:
parent
2574a63975
commit
ed542582f9
@ -37,6 +37,9 @@ class ToUpperCase extends Operation {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
|
if (!args || args.length === 0) {
|
||||||
|
throw new OperationException("No capitalization scope was provided.");
|
||||||
|
}
|
||||||
const scope = args[0];
|
const scope = args[0];
|
||||||
if (scope === "All") {
|
if (scope === "All") {
|
||||||
return input.toUpperCase();
|
return input.toUpperCase();
|
||||||
|
Loading…
Reference in New Issue
Block a user