utility: Fixed crash when creating Timepoint with empty string

This commit is contained in:
Eberhard Graether
2015-11-04 15:12:35 +01:00
parent 961d0fe541
commit bcbeacb951
+5 -1
View File
@@ -16,8 +16,12 @@ TimePoint::TimePoint(boost::posix_time::ptime t)
//}
TimePoint::TimePoint(std::string s)
: m_time(boost::posix_time::not_a_date_time)
{
m_time = boost::posix_time::time_from_string(s);
if (s.size())
{
m_time = boost::posix_time::time_from_string(s);
}
}
std::string TimePoint::toString() const