Skip to content

Commit

Permalink
createCallback: better check for cb existence (bsc#1063459)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Oct 23, 2017
1 parent e35fba2 commit 3fcc1b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Callbacks.YCP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,21 @@
const _cbdata_t::const_iterator tmp1 = _cbdata.find(id_r);

if (tmp1 == _cbdata.end())
{
y2debug ("Callback %s not found", cbName(id_r).c_str());
return NULL;
}
if (tmp1->second.empty())
{
y2debug ("Callback %s is empty", cbName(id_r).c_str());
return NULL;
}

const YCPReference func(tmp1->second.top());

if (func.isNull() || ! func->isReference())
{
// TODO
// ycp2error ("Unexpected function pointer: %s"
// , ptr.isNull () ? "NULL" : ptr->toString ().c_str ());
y2debug ("Callback %s is not a func reference", cbName(id_r).c_str());
return NULL;
}

Expand Down

0 comments on commit 3fcc1b2

Please sign in to comment.