File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
library/src/main/java/com/opensource/svgaplayer Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,20 @@ internal class SVGAPath {
29
29
}
30
30
val firstLetter = item.substring(0 , 1 )
31
31
if (VALID_METHODS .contains(firstLetter)) {
32
- if ( null != argLast) {
33
- args.add(SVGAPoint (0.0f , 0.0f , argLast .toFloat()))
32
+ argLast?. takeIf { it.isNotEmpty() }?. let {
33
+ args.add(SVGAPoint (0.0f , 0.0f , try {it .toFloat()} catch (e : Exception ) { 0.0f } ))
34
34
}
35
35
this .operate(finalPath, currentMethod, args)
36
36
args.clear()
37
37
currentMethod = firstLetter
38
38
argLast = item.substring(1 )
39
39
} else {
40
40
if (null != argLast && argLast.trim { it <= ' ' }.length > 0 ) {
41
- args.add(SVGAPoint (argLast.toFloat(), item.toFloat(), 0.0f ))
41
+ args.add(SVGAPoint (try {
42
+ argLast.toFloat()
43
+ } catch (e: Exception ) {0.0f }, try {
44
+ item.toFloat()
45
+ } catch (e: Exception ) {0.0f }, 0.0f ))
42
46
argLast = null
43
47
} else {
44
48
argLast = item
You can’t perform that action at this time.
0 commit comments