Skip to content

Commit 9806e72

Browse files
committed
fix copilot comments
1 parent a0e86f4 commit 9806e72

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/lizard/lizardRunner.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ func RunLizard(workDirectory string, binary string, files []string, outputFile s
7272
var stdout bytes.Buffer
7373
cmd.Stdout = &stdout
7474

75-
cmd.Run()
75+
err = cmd.Run()
7676

7777
if stderr.Len() > 0 {
7878
logger.Debug("Failed to run Lizard: ", logrus.Fields{
79-
"error": err.Error(),
79+
"error": err != nil ? err.Error() : "unknown error",
8080
"stderr": string(stderr.Bytes()),
8181
})
8282

@@ -115,9 +115,9 @@ func RunLizard(workDirectory string, binary string, files []string, outputFile s
115115
cmd.Stdout = os.Stdout
116116
err = cmd.Run()
117117

118-
if stderr.Len() > 0 {
118+
if stderr.Len() > 0 && err != nil {
119119
logger.Debug("Failed to run Lizard: ", logrus.Fields{
120-
"error": err.Error(),
120+
"error": err != nil ? err.Error() : "unknown error",
121121
"stderr": string(stderr.Bytes()),
122122
})
123123

0 commit comments

Comments
 (0)