diff --git a/src/renderer/tvgText.h b/src/renderer/tvgText.h index 8af4fcf1..85a271a4 100644 --- a/src/renderer/tvgText.h +++ b/src/renderer/tvgText.h @@ -125,8 +125,8 @@ struct Text::Impl if (!load()) return nullptr; //transform the gradient coordinates based on the final scaled font. - if (P(paint)->flag & RenderUpdateFlag::Gradient) { - auto fill = P(paint)->rs.fill; + auto fill = P(paint)->rs.fill; + if (fill && P(paint)->flag & RenderUpdateFlag::Gradient) { auto scale = 1.0f / loader->scale; if (fill->type() == Type::LinearGradient) { P(static_cast(fill))->x1 *= scale;