From 5af21dfad816a2a41594c02512b1dfc97818f60a Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 18 Dec 2017 09:48:17 -0800 Subject: [PATCH] Fix timezone constructor crash when zone file has no transitions. --- libgnucash/engine/gnc-timezone.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libgnucash/engine/gnc-timezone.cpp b/libgnucash/engine/gnc-timezone.cpp index 0a26b484be..96f164cd75 100644 --- a/libgnucash/engine/gnc-timezone.cpp +++ b/libgnucash/engine/gnc-timezone.cpp @@ -677,8 +677,9 @@ TimeZoneProvider::parse_file(const std::string& tzname) /* if the transitions end before the end of the zoneinfo coverage * period then the zone rescinded DST and we need a final no-dstzone. */ - if (last_time.is_not_a_date_time() || - last_time.date().year() < parser.last_year) + if (last_time.is_not_a_date_time()) + zone_vector.push_back(zone_no_dst(max_year, last_info)); + else if (last_time.date().year() < parser.last_year) zone_vector.push_back(zone_no_dst(last_time.date().year(), last_info)); }