Skip to content

Commit

Permalink
Fix issue of NullPointerException on html-img-tag based on data-URL (e…
Browse files Browse the repository at this point in the history
…clipse-birt#1383)

* Fix issue of NullPointerException on html-img-tag based on data-URL
(eclipse-birt#1382)

* reuse of img-variable to avoid doubled handleStyleImage()-call
  • Loading branch information
speckyspooky authored Jul 27, 2023
1 parent eca2149 commit b4c2cc9
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ public void start(IReportContent report) {
writeBidiFlag();
writer.openTag(HTMLTags.TAG_HEAD);


// write the title of the report in html.
outputReportTitle(report);

Expand All @@ -783,7 +783,7 @@ public void start(IReportContent report) {
}
}


outputCSSStyles(reportDesign, designHandle);

if (needFixTransparentPNG) {
Expand Down Expand Up @@ -2661,9 +2661,13 @@ public void startNode(Node node, HashMap<?, ?> cssStyles) {

if (attrValue != null) {
if ("img".equalsIgnoreCase(nodeName) && "src".equalsIgnoreCase(attrName)) {
String attrValueTrue = handleStyleImage(attrValue).getUri();
if (attrValueTrue != null) {
attrValue = attrValueTrue;
BackgroundImageInfo img = handleStyleImage(attrValue);
String attrValueTrue = null;
if (img != null) {
attrValueTrue = img.getUri();
if (attrValueTrue != null) {
attrValue = attrValueTrue;
}
}
}
writer.attribute(attrName, attrValue);
Expand Down

0 comments on commit b4c2cc9

Please sign in to comment.