Fixed assignment with an empty node (new API) - a segfault that only showed up in debuggable

This commit is contained in:
beder
2011-12-20 22:19:54 -06:00
parent 66980da9d2
commit 569a0461f2
2 changed files with 11 additions and 1 deletions

View File

@@ -100,7 +100,9 @@ namespace YAML
// assignment
inline bool Node::is(const Node& rhs) const
{
return m_pNode ? m_pNode->is(*rhs.m_pNode) : false;
if(!m_pNode || !rhs.m_pNode)
return false;
return m_pNode->is(*rhs.m_pNode);
}
template<typename T>