Skip to content

Commit

Permalink
Fix NPE when path contains new lines between coordinates, add the test
Browse files Browse the repository at this point in the history
DEVSIX-8704

Autoported commit.
Original commit hash: [37dda083d]
  • Loading branch information
Andrei Stryhelski authored and iText-CI committed Oct 28, 2024
1 parent 4d88123 commit 72d9e0e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -526,5 +526,10 @@ public virtual void ParseDoubleValues() {
// So this test checks if there are any differences
ConvertAndCompare(sourceFolder, destinationFolder, "svgStackOver");
}

[NUnit.Framework.Test]
public virtual void ParsePathWithNewLinesTest() {
ConvertAndCompareSinglePage(sourceFolder, destinationFolder, "pathWithNewLines");
}
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ internal virtual ICollection<String> ParsePathOperations() {
throw new SvgProcessingException(SvgExceptionMessageConstant.INVALID_PATH_D_ATTRIBUTE_OPERATORS).SetMessageParams
(pathString);
}
pathString = iText.Commons.Utils.StringUtil.ReplaceAll(pathString, "\\s+", " ").Trim();
String[] operators = SplitPathStringIntoOperators(pathString);
foreach (String inst in operators) {
String instTrim = inst.Trim();
Expand Down
2 changes: 1 addition & 1 deletion port-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d7b7288459c53470547f639cf5386cb2636c2eca
37dda083dcfd94979087cd526aa7936c74c4fdc7

0 comments on commit 72d9e0e

Please sign in to comment.