From ffbe5ecde28e6c141a726c3301e40e263f87b67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Ferrer=20Ortiz?= Date: Sun, 26 Apr 2020 13:51:07 +0200 Subject: [PATCH] Time: Fix flattening of countries with one subitem and no timezone on the parent. Fixes #15907. Change-Id: I10d81ca92539b3430607c10ebaa9fe7f1080ef0b Reviewed-on: https://review.haiku-os.org/c/haiku/+/2517 Reviewed-by: Adrien Destugues --- src/preferences/time/ZoneView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/preferences/time/ZoneView.cpp b/src/preferences/time/ZoneView.cpp index 2b85e67322..bd6e81227a 100644 --- a/src/preferences/time/ZoneView.cpp +++ b/src/preferences/time/ZoneView.cpp @@ -441,9 +441,10 @@ TimeZoneView::_BuildZoneMenu() zoneIter->second->SetCountry(currentItem->HasCountry() ? new(std::nothrow) BCountry(currentItem->Country()) : NULL); - zoneIter->second->SetTimeZone(currentItem->HasTimeZone() - ? new(std::nothrow) BTimeZone(currentItem->TimeZone()) - : NULL); + if (currentItem->HasTimeZone()) { + zoneIter->second->SetTimeZone(new(std::nothrow) + BTimeZone(currentItem->TimeZone())); + } zoneIter->second->SetOutlineLevel(1); delete currentItem; }