Skip to content

Commit cd97cdb

Browse files
author
Alexandr Fedorov
committed
fix NPE when converting OL with attribute type="circle"
DEVSIX-9452
1 parent 5e0155c commit cd97cdb

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/test/java/com/itextpdf/html2pdf/css/ListCssTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,9 @@ public void digitTypeTest() throws IOException, InterruptedException {
7474
convertToPdfAndCompare("1Type", SOURCE_FOLDER, DESTINATION_FOLDER);
7575
}
7676

77-
//TODO: DEVSIX-6128 NullPointerException when trying to convert html with non-existing ol type.
7877
@Test
79-
public void unsupportedType() {
80-
Assertions.assertThrows(NullPointerException.class,
81-
() -> convertToPdfAndCompare("unsupportedType", SOURCE_FOLDER, DESTINATION_FOLDER));
78+
public void unsupportedType() throws IOException, InterruptedException {
79+
convertToPdfAndCompare("unsupportedType", SOURCE_FOLDER, DESTINATION_FOLDER);
8280
}
8381

8482
@Test

src/test/java/com/itextpdf/html2pdf/css/resolve/HtmlStylesToCssConverterTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ public void trimSemicolonsForHeightAttributeTest() {
6262
assertCssDeclarationListWithOneElement(cssDeclarations, "height", "51%");
6363
}
6464

65+
@Test
66+
public void invalidAttributeValue() {
67+
final Element element = new Element(Tag.valueOf(TagConstants.OL), "");
68+
element.attr("type", "circle");
69+
JsoupElementNode node = new JsoupElementNode(element);
70+
List<CssDeclaration> cssDeclarations = HtmlStylesToCssConverter.convert(node);
71+
assertCssDeclarationListWithOneElement(cssDeclarations, "list-style-type", null);
72+
}
73+
6574
@Test
6675
public void withoutSemicolonsHeightAttributeTest() {
6776
final Element element = new Element(Tag.valueOf(TagConstants.IMG), "");
Binary file not shown.

0 commit comments

Comments
 (0)