mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 14:41:50 +00:00
SvgLoader: Add null check
Since the pointer actually used inside the if condition is loader->def, add a null check for this.
This commit is contained in:
parent
6768e11eed
commit
c27a952f44
1 changed files with 1 additions and 1 deletions
|
@ -1974,7 +1974,7 @@ static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content,
|
|||
// But finally, the loader has a gradient style list regardless of defs.
|
||||
// This is only to support this when multiple gradients are declared, even if no defs are declared.
|
||||
// refer to: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs
|
||||
if (loader->doc->node.doc.defs) {
|
||||
if (loader->def && loader->doc->node.doc.defs) {
|
||||
loader->def->node.defs.gradients.push(gradient);
|
||||
} else {
|
||||
loader->gradients.push(gradient);
|
||||
|
|
Loading…
Add table
Reference in a new issue