guard against null ptr access

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2011-02-02 07:36:18 +00:00
parent 4d3de2c5f7
commit 2f250cb6e6

View File

@ -819,9 +819,19 @@ private:
reference_type operator*() const \
{ return *(pointer_type)m_node->GetDataPtr(); } \
ptrop \
itor& operator++() { m_node = m_node->GetNext(); return *this; }\
itor& operator++() \
{ \
if (m_node) \
m_node = m_node->GetNext(); \
return *this; \
} \
const itor operator++(int) \
{ itor tmp = *this; m_node = m_node->GetNext(); return tmp; }\
{ \
itor tmp = *this; \
if (m_node) \
m_node = m_node->GetNext(); \
return tmp; \
} \
itor& operator--() \
{ \
m_node = m_node ? m_node->GetPrevious() : m_init; \
@ -862,9 +872,19 @@ private:
reference_type operator*() const \
{ return *(pointer_type)m_node->GetDataPtr(); } \
ptrop \
itor& operator++() { m_node = m_node->GetNext(); return *this; }\
itor& operator++() \
{ \
if (m_node) \
m_node = m_node->GetNext(); \
return *this; \
} \
const itor operator++(int) \
{ itor tmp = *this; m_node = m_node->GetNext(); return tmp; }\
{ \
itor tmp = *this; \
if (m_node) \
m_node = m_node->GetNext(); \
return tmp; \
} \
itor& operator--() \
{ \
m_node = m_node ? m_node->GetPrevious() : m_init; \