From ce468cff76d30967351fcceab53a696cb9022ed3 Mon Sep 17 00:00:00 2001 From: Tomoki Nakagawa Date: Fri, 21 Feb 2025 09:57:04 +0000 Subject: [PATCH] Compare explicitly against nullptr. Follow-up to 6f0fbad. PiperOrigin-RevId: 729438488 --- src/base/singleton.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/singleton.h b/src/base/singleton.h index 468e45328..4db06931e 100644 --- a/src/base/singleton.h +++ b/src/base/singleton.h @@ -112,7 +112,8 @@ template class SingletonMockable { public: static Interface *Get() { - if (Interface *mock = mock_.load(std::memory_order_acquire)) { + if (Interface *mock = mock_.load(std::memory_order_acquire); + mock != nullptr) { return mock; } static absl::NoDestructor impl;