Verified Commit 5f15b65c authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core/contact: throw when no contact is available

parent 8cb5e267
......@@ -255,6 +255,9 @@ public:
/// @brief get the i-th contact calculated
const Contact& getContact(size_t i) const
{
if(contacts.size() == 0)
throw std::invalid_argument("The number of contacts is zero. No Contact can be returned.");
if(i < contacts.size())
return contacts[i];
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment