Skip to content

Commit a280fe2

Browse files
authored
Merge pull request #87 from anders007/master
bool vector operator [] crash
2 parents 70dde05 + ff2c059 commit a280fe2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

inc/behaviac/agent/agent.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ namespace behaviac {
651651
void set(bool v) {
652652
behaviac::THREAD_ID_TYPE threadId = behaviac::GetTID();
653653
bool* value = m_threadInt.find((long)threadId);
654+
if (!value)
655+
{
656+
m_threadInt.add((long)threadId, v);
657+
return;
658+
}
654659
BEHAVIAC_ASSERT(value);
655660
*value = v;
656661
}

0 commit comments

Comments
 (0)