Prevent crash

pull/174/head
M66B 5 years ago
parent de1dce29a3
commit 2c11b9c0b1

@ -411,9 +411,10 @@ public class HtmlHelper {
case "display": case "display":
// https://developer.mozilla.org/en-US/docs/Web/CSS/display // https://developer.mozilla.org/en-US/docs/Web/CSS/display
if (!display_hidden && "none".equals(value)) { if (element.parent() != null &&
Log.i("Removing hidden element " + element.tagName()); !display_hidden && "none".equals(value)) {
element.empty(); Log.i("Removing display none " + element.tagName());
element.remove();
} }
if ("inline".equals(value) || "inline-block".equals(value)) { if ("inline".equals(value) || "inline-block".equals(value)) {
if (element.nextSibling() != null) if (element.nextSibling() != null)
@ -425,11 +426,11 @@ public class HtmlHelper {
case "width": case "width":
//case "font-size": //case "font-size":
//case "line-height": //case "line-height":
if (!display_hidden) { if (element.parent() != null && !display_hidden) {
Float s = getFontSize(value); Float s = getFontSize(value);
if (s != null && s == 0) { if (s != null && s == 0) {
Log.i("Removing hidden element " + element.tagName()); Log.i("Removing no height/width " + element.tagName());
element.empty(); element.remove();
} }
} }
break; break;

Loading…
Cancel
Save