Make sure get_last_updates() contains atleast one entry before calling .front()
[bpdyndnsd] / src / updater.cpp
index bbf3454..852b46b 100644 (file)
@@ -241,7 +241,7 @@ void Updater::update_services(bool changed_to_online) const
         time_t current_time = time(NULL);
 
         // Try to get the lastupdated time of the actual service if there is one.
-        if ( service->get_last_updates().size() > 0 )
+        if ( !service->get_last_updates().empty() )
             lastupdated = service->get_last_updates().front(); /*lint !e1793 */
 
         Log->print_check_service_update(hostname, current_time, lastupdated);