diff --git a/eo/src/eoPop.h b/eo/src/eoPop.h index 3ea53f46..371fdfd0 100644 --- a/eo/src/eoPop.h +++ b/eo/src/eoPop.h @@ -201,6 +201,8 @@ public: #else typename eoPop::const_iterator it = std::max_element(begin(), end()); #endif + if( it == end() ) + throw std::runtime_error("eoPop: Empty population, when calling best_element()."); return (*it); }