Validate timeperiod segments

fixes #8309
This commit is contained in:
Gunnar Beutner 2015-01-29 14:14:56 +01:00
parent a3e0c9d898
commit 2f44581f14
2 changed files with 4 additions and 0 deletions

View File

@ -381,6 +381,7 @@ bool ConfigItem::ActivateItems(void)
}
upq.Join();
upq.ReportExceptions("ConfigItem");
#ifdef I2_DEBUG
BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {

View File

@ -379,6 +379,9 @@ void LegacyTimePeriod::ProcessTimeRanges(const String& timeranges, tm *reference
BOOST_FOREACH(const String& range, ranges) {
Dictionary::Ptr segment = ProcessTimeRange(range, reference);
if (segment->Get("begin") >= segment->Get("end"))
BOOST_THROW_EXCEPTION(std::invalid_argument("Time period segment ends before it begins"));
result->Add(segment);
}
}