Skip to content

Commit

Permalink
Fix null-pointerderef for frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed May 11, 2023
1 parent 9aada20 commit 996813e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions opencog/atoms/base/Atom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ void Atom::getCoveredInc(const AtomSpace* as, HandleSet& hs, Type t) const
{
getLocalInc(as, hs, t);
AtomSpace* eva = _atom_space;

// If we are a FRAME, then it is possible that the owning
// _atom_space is not set. Avoid a null-pointer deref. See
// https://github.com/opencog/atomspace-rocks/issues/20
if (nullptr == eva) return;

while (true)
{
size_t asz = eva->size();
Expand Down

0 comments on commit 996813e

Please sign in to comment.