2
0
mirror of https://github.com/gchq/CyberChef synced 2025-12-05 23:53:27 +00:00

fix bug where no input leads to error in console

This commit is contained in:
Adamkadaban
2025-01-13 15:48:18 -05:00
parent 54e559c5a6
commit 6b75ba8903

View File

@@ -39,7 +39,7 @@ class AddLineNumbers extends Operation {
run(input, args) {
const lines = input.split("\n"),
width = lines.length.toString().length;
const offset = parseInt(args[0], 10);
const offset = args[0] ? parseInt(args[0], 10) : 0;
let output = "";
for (let n = 0; n < lines.length; n++) {