svg_loader: prevent dangling node in exception case.

We prefer the independent unit function behavior.
This commit is contained in:
Hermet Park 2020-09-04 11:47:16 +09:00
parent 3018fe29cd
commit b40016c81d

View file

@ -1448,7 +1448,7 @@ static void _copyAttr(SvgNode* to, SvgNode* from)
static void _cloneNode(SvgNode* from, SvgNode* parent) static void _cloneNode(SvgNode* from, SvgNode* parent)
{ {
SvgNode* newNode; SvgNode* newNode;
if (!from) return; if (!from || !parent) return;
newNode = _createNode(parent, from->type); newNode = _createNode(parent, from->type);
_copyAttr(newNode, from); _copyAttr(newNode, from);