From ba885e318ab354e56c627c3763c57b69730d04c3 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Sun, 15 Mar 2026 23:18:12 +0900 Subject: [PATCH] Fix inverted null check in time_zone_name_win.cc This commit follows up the previous commit [1], which aimed to improve the code but ended up introducing an inverted null check in time_zone_name_win.cc. As a result, LoadIcuGetTimeZoneIDForWindowsID() currently returns nullptr when it should be returning a valid time zone ID. This is also a preparation for implementing TimeZoneIf with Windows time APIs (#328). [1] 27ca17317e9e5772bcf30d5e21cf837b5525442a --- src/time_zone_name_win.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/time_zone_name_win.cc b/src/time_zone_name_win.cc index daa9a56..d3d9566 100644 --- a/src/time_zone_name_win.cc +++ b/src/time_zone_name_win.cc @@ -112,7 +112,7 @@ ucal_getTimeZoneIDForWindowsID_func LoadIcuGetTimeZoneIDForWindowsID() { const auto ucal_getTimeZoneIDForWindowsIDRef = AsProcAddress( icu_dll, "ucal_getTimeZoneIDForWindowsID"); - if (ucal_getTimeZoneIDForWindowsIDRef != nullptr) { + if (ucal_getTimeZoneIDForWindowsIDRef == nullptr) { g_unavailable.store(true, std::memory_order_relaxed); return nullptr; }