commit | ee8b0f6b15f405d6ceaaf6a564290b42843b3529 | [log] [tgz] |
---|---|---|
author | Prashanth Swaminathan <prashanthsw@google.com> | Tue Feb 02 19:49:10 2021 -0800 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Feb 03 17:10:45 2021 +0000 |
tree | 09e26171eee009d300389a25862a700f0bc723c8 | |
parent | be29ad9c7b1341fcfc3340ff3b8183b4f4112cf1 [diff] |
pw_unit_test: Fix possible nullptr dereference Change-Id: I7056e52e9926d1a90a26c210c38c9a8753cf805b Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/31621 Reviewed-by: Alexei Frolov <frolv@google.com> Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
diff --git a/pw_unit_test/framework.cc b/pw_unit_test/framework.cc index 5b7975f..69529bc 100644 --- a/pw_unit_test/framework.cc +++ b/pw_unit_test/framework.cc
@@ -56,7 +56,7 @@ for (const TestInfo* test = tests_; test != nullptr; test = test->next()) { if (test->enabled()) { test->run(); - } else { + } else if (event_handler_ != nullptr) { event_handler_->TestCaseDisabled(test->test_case()); } }