Since the pointer actually used inside the if condition is loader->def,
add a null check for this.
Change-Id: I5578553fcfef42b04d02bb0c6de012e5e0f586f2
// 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);