Skip to content

Commit

Permalink
Protect against null cnode when loading LocalNodes from database
Browse files Browse the repository at this point in the history
  • Loading branch information
mattw-mega committed Dec 9, 2020
1 parent 09782a1 commit c917ddc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,9 +1444,12 @@ void LocalNode::setnode(Node* cnode)
{
deleted = false;

if (cnode) cnode->localnode.reset();
node.reset();
node.crossref(cnode, this);
if (cnode)
{
cnode->localnode.reset();
node.crossref(cnode, this);
}
}

void LocalNode::setnotseen(int newnotseen)
Expand Down

0 comments on commit c917ddc

Please sign in to comment.