aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-04-26 12:53:20 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-04-26 11:42:18 +0000
commit719eea2fe74cb5d7485be9f8d4b4709b745c4d2f (patch)
tree30d15ff6441c6eacd30381da042a88b2914bd440
parent2a444fae4fd848ad3bd2c0a3eb13fdad8280fd30 (diff)
dashboard/app: prevent staticcheck false positive
Otherwise it complains: dashboard/app/tree_test.go:1136:5: SA5011(related information): this check suggests that the pointer can be nil if found == nil { ^
-rw-r--r--dashboard/app/tree_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/dashboard/app/tree_test.go b/dashboard/app/tree_test.go
index f12799b42..e2e5b8fd0 100644
--- a/dashboard/app/tree_test.go
+++ b/dashboard/app/tree_test.go
@@ -1135,6 +1135,7 @@ func (ctx *treeTestCtx) doJob(resp *dashapi.JobPollResp, day int) {
}
if found == nil {
ctx.ctx.t.Fatalf("unknown job request: %#v", resp)
+ return // to avoid staticcheck false positive about nil deref
}
// Figure out what should the result be.
result := treeTestOK