From df3277a5cc4bb0ff85cf183e4a0776558b24e6ba Mon Sep 17 00:00:00 2001 From: debuggerx Date: Wed, 28 Apr 2021 00:12:32 +0800 Subject: [PATCH] fix: index not in range error. --- bin/pre_script.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/pre_script.dart b/bin/pre_script.dart index 1d89b76..658280b 100644 --- a/bin/pre_script.dart +++ b/bin/pre_script.dart @@ -176,7 +176,8 @@ void walkPath(FileSystemEntity path) { operations.forEach((operation) { if (operation.commented && - !lines[operation.lineNumber - 1].startsWith(_commentReg)) + !lines[operation.lineNumber - 1].startsWith(_commentReg) && + lines[operation.lineNumber - 1].trim().length > 0) lines[operation.lineNumber - 1] = '${' ' * operation.indent}// ${lines[operation.lineNumber - 1].substring(operation.indent)}'; else if (!operation.commented &&