diff --git a/libraries/shared/src/AgentList.cpp b/libraries/shared/src/AgentList.cpp index cc9b7b06ed..51a14d8cb1 100644 --- a/libraries/shared/src/AgentList.cpp +++ b/libraries/shared/src/AgentList.cpp @@ -64,8 +64,7 @@ AgentList::AgentList(char newOwnerType, unsigned int newSocketListenPort) : agentSocket(newSocketListenPort), ownerType(newOwnerType), socketListenPort(newSocketListenPort), - lastAgentId(0) -{ + lastAgentId(0) { pthread_mutex_init(&mutex, 0); } @@ -483,7 +482,8 @@ AgentList::iterator AgentList::begin() const { } } - return AgentListIterator(this, 0); + // there's no alive agent to start from - return the end + return end(); } AgentList::iterator AgentList::end() const {