File tree 4 files changed +23
-2
lines changed
packages/vector_graphics_compiler
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
+
1
5
## 1.1.14
2
6
3
7
* Makes the package WASM compatible.
Original file line number Diff line number Diff line change @@ -895,7 +895,10 @@ class SvgParser {
895
895
return false ;
896
896
}
897
897
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
+ }
899
902
final PathNode drawable = PathNode (path, _currentAttributes);
900
903
checkForIri (drawable);
901
904
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: vector_graphics_compiler
2
2
description : A compiler to convert SVGs to the binary format used by `package:vector_graphics`.
3
3
repository : https://github.com/flutter/packages/tree/main/packages/vector_graphics_compiler
4
4
issue_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
6
6
7
7
executables :
8
8
vector_graphics_compiler :
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import 'dart:io';
7
7
import 'package:flutter_test/flutter_test.dart' ;
8
8
import 'package:vector_graphics_compiler/src/svg/numbers.dart' ;
9
9
import 'package:vector_graphics_compiler/vector_graphics_compiler.dart' ;
10
+
10
11
import 'test_svg_strings.dart' ;
11
12
12
13
void main () {
@@ -1948,6 +1949,19 @@ void main() {
1948
1949
],
1949
1950
);
1950
1951
});
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
+ });
1951
1965
}
1952
1966
1953
1967
const List <Paint > ghostScriptTigerPaints = < Paint > [
You can’t perform that action at this time.
0 commit comments