Skip to content

Commit 8cf4068

Browse files
authored
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.
1 parent 6a5242f commit 8cf4068

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/src/main/java/com/horcrux/svg/SVGLength.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ static SVGLength from(Dynamic dynamic) {
104104
}
105105

106106
static SVGLength from(String string) {
107-
return new SVGLength(string);
107+
return string != null ? new SVGLength(string) : new SVGLength();
108108
}
109109

110110
static SVGLength from(Double value) {
111-
return new SVGLength(value);
111+
return value != null ? new SVGLength(value) : new SVGLength();
112112
}
113113

114114
static String toString(Dynamic dynamic) {

0 commit comments

Comments
 (0)