Make sure get_last_updates() contains atleast one entry before calling .front()
[bpdyndnsd] / src / serviceholder.cpp
index ed4efe0..1eee942 100644 (file)
@@ -67,7 +67,8 @@ int Serviceholder::serialize_services() const
 
     BOOST_FOREACH(const Service::Ptr &service, OldServices)
     {
-        if ( ( service->get_last_updates().front() + ((time_t)service->get_update_interval()*60) ) >= current_time )  /*lint !e1793 */ // UpdateInterval timeout of service isn't expired.
+        if ( !service->get_last_updates().empty() &&
+             ( service->get_last_updates().front() + ((time_t)service->get_update_interval()*60) ) >= current_time )  /*lint !e1793 */ // UpdateInterval timeout of service isn't expired.
             service_container->add_service(service);
     }