mirror of
https://github.com/gchq/CyberChef
synced 2025-12-15 07:43:22 +00:00
fix bug where no input leads to error in console
This commit is contained in:
@@ -39,7 +39,7 @@ class AddLineNumbers extends Operation {
|
|||||||
run(input, args) {
|
run(input, args) {
|
||||||
const lines = input.split("\n"),
|
const lines = input.split("\n"),
|
||||||
width = lines.length.toString().length;
|
width = lines.length.toString().length;
|
||||||
const offset = parseInt(args[0], 10);
|
const offset = args[0] ? parseInt(args[0], 10) : 0;
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
for (let n = 0; n < lines.length; n++) {
|
for (let n = 0; n < lines.length; n++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user