From 8cf406888034c6a468e652558fea8236a01a75c9 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Fri, 28 Oct 2022 14:59:49 +0200 Subject: [PATCH] fix: handle null passed to SvgLength (#1903) SvgLength from method should be able to parse null since it is a correct value, we then use the empty constructor since it provides default values. --- android/src/main/java/com/horcrux/svg/SVGLength.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/horcrux/svg/SVGLength.java b/android/src/main/java/com/horcrux/svg/SVGLength.java index e5899836..e5830833 100644 --- a/android/src/main/java/com/horcrux/svg/SVGLength.java +++ b/android/src/main/java/com/horcrux/svg/SVGLength.java @@ -104,11 +104,11 @@ class SVGLength { } static SVGLength from(String string) { - return new SVGLength(string); + return string != null ? new SVGLength(string) : new SVGLength(); } static SVGLength from(Double value) { - return new SVGLength(value); + return value != null ? new SVGLength(value) : new SVGLength(); } static String toString(Dynamic dynamic) {