File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
packages/vector_graphics_compiler Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 1.1.15
2+
3+ * Fixes an issue where empty tag could throw and broke SVG.
4+
15## 1.1.14
26
37* Makes the package WASM compatible.
Original file line number Diff line number Diff line change @@ -895,7 +895,10 @@ class SvgParser {
895895 return false ;
896896 }
897897 final ParentNode parent = _parentDrawables.last.drawable;
898- final Path path = pathFunc (this )! ;
898+ final Path ? path = pathFunc (this );
899+ if (path == null ) {
900+ return false ;
901+ }
899902 final PathNode drawable = PathNode (path, _currentAttributes);
900903 checkForIri (drawable);
901904
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: vector_graphics_compiler
22description : A compiler to convert SVGs to the binary format used by `package:vector_graphics`.
33repository : https://github.com/flutter/packages/tree/main/packages/vector_graphics_compiler
44issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+vector_graphics%22
5- version : 1.1.14
5+ version : 1.1.15
66
77executables :
88 vector_graphics_compiler :
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import 'dart:io';
77import 'package:flutter_test/flutter_test.dart' ;
88import 'package:vector_graphics_compiler/src/svg/numbers.dart' ;
99import 'package:vector_graphics_compiler/vector_graphics_compiler.dart' ;
10+
1011import 'test_svg_strings.dart' ;
1112
1213void main () {
@@ -1948,6 +1949,19 @@ void main() {
19481949 ],
19491950 );
19501951 });
1952+
1953+ test ('Parse empty tag' , () {
1954+ const String svgStr = '''
1955+ <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
1956+ <polygon
1957+ fill="#0a287d"
1958+ points=""
1959+ id="triangle"/>
1960+ </svg>
1961+ ''' ;
1962+
1963+ expect (parseWithoutOptimizers (svgStr), isA <VectorInstructions >());
1964+ });
19511965}
19521966
19531967const List <Paint > ghostScriptTigerPaints = < Paint > [
You can’t perform that action at this time.
0 commit comments