size_t *pIndex = (size_t *)&cookie;
if ( *pIndex < children.Count() )
{
- return children.Item(*pIndex++);
+ return children.Item((*pIndex)++);
}
else
{
if (!next)
{
wxTreeItemId current = m_key_current;
- while (current && !next)
+ while (current.IsOk() && !next)
{
current = GetItemParent( current );
if (current) next = GetNextSibling( current );