Fix crash in PropertyStream::find

This commit is contained in:
Vinnie Falco
2013-10-21 17:30:00 -07:00
parent 29c38ef0d4
commit 2ec6050959

View File

@@ -294,14 +294,16 @@ std::pair <PropertyStream::Source*, bool> PropertyStream::Source::find (std::str
SharedState::Access state (source->m_state); SharedState::Access state (source->m_state);
for (List <Item>::iterator iter (state->children.begin());;) for (List <Item>::iterator iter (state->children.begin());;)
{ {
if (iter == state->children.end())
return std::make_pair (nullptr, false);
if (iter->source().m_name == s) if (iter->source().m_name == s)
{ {
source = &iter->source(); source = &iter->source();
break; break;
} }
if (++iter == state->children.end()) ++iter;
return std::make_pair (nullptr, false);
} }
} }
} }