forked from len0rd/rockbox
regtools/soc_desc: fix bug in library
Because a node ref is at root doesn't make it valid, check that soc is valid otherwise we return garbage. Change-Id: I6e5befc959dc670ab39a87484e87af6d90be7726
This commit is contained in:
parent
6f0f1193e5
commit
fafb770ca5
1 changed files with 1 additions and 1 deletions
|
@ -1035,7 +1035,7 @@ namespace
|
||||||
std::vector< node_t > *get_children(node_ref_t node)
|
std::vector< node_t > *get_children(node_ref_t node)
|
||||||
{
|
{
|
||||||
if(node.is_root())
|
if(node.is_root())
|
||||||
return &node.soc().get()->node;
|
return node.soc().valid() ? &node.soc().get()->node : 0;
|
||||||
node_t *n = node.get();
|
node_t *n = node.get();
|
||||||
return n == 0 ? 0 : &n->node;
|
return n == 0 ? 0 : &n->node;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue