mirror of
https://github.com/google/benchmark.git
synced 2025-04-29 14:30:37 +08:00
Check families is not nullptr before using it
When there's no benchmarks, families becomes nullptr. So before touching it, we need to ensure families is not nullptr.
This commit is contained in:
parent
254a6f9a78
commit
45b79c3e01
1
AUTHORS
1
AUTHORS
@ -14,3 +14,4 @@ Dominic Hamon <dma@stripysock.com>
|
||||
Eugene Zhuk <eugene.zhuk@gmail.com>
|
||||
Google Inc.
|
||||
Oleksandr Sochka <sasha.sochka@gmail.com>
|
||||
Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
@ -28,3 +28,4 @@ Dominic Hamon <dma@stripysock.com>
|
||||
Eugene Zhuk <eugene.zhuk@gmail.com>
|
||||
Oleksandr Sochka <sasha.sochka@gmail.com>
|
||||
Pierre Phaneuf <pphaneuf@google.com>
|
||||
Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
@ -757,6 +757,7 @@ void Benchmark::FindBenchmarks(const std::string& spec,
|
||||
}
|
||||
|
||||
mutex_lock l(&benchmark_mutex);
|
||||
if (families == nullptr) return; // There's no families.
|
||||
for (Benchmark* family : *families) {
|
||||
if (family == nullptr) continue; // Family was deleted
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user