Fixed null pointer possibility in CssParser

This commit is contained in:
nathan 2017-06-15 01:21:45 +02:00
parent 2690d9aae4
commit c44620712b

View File

@ -403,15 +403,17 @@ class CssParser {
// get the attribute from the highest scoring node // get the attribute from the highest scoring node
//noinspection ConstantConditions //noinspection ConstantConditions
for (CssAttribute attribute : maxNode.attributes) { if (maxNode != null) {
if (equalsOrContained) { for (CssAttribute attribute : maxNode.attributes) {
if (attribute.key.equals(attributeName)) { if (equalsOrContained) {
return attribute.value; if (attribute.key.equals(attributeName)) {
return attribute.value;
}
} }
} else {
else { if (attribute.key.contains(attributeName)) {
if (attribute.key.contains(attributeName)) { return attribute.value;
return attribute.value; }
} }
} }
} }