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
//noinspection ConstantConditions
for (CssAttribute attribute : maxNode.attributes) {
if (equalsOrContained) {
if (attribute.key.equals(attributeName)) {
return attribute.value;
if (maxNode != null) {
for (CssAttribute attribute : maxNode.attributes) {
if (equalsOrContained) {
if (attribute.key.equals(attributeName)) {
return attribute.value;
}
}
}
else {
if (attribute.key.contains(attributeName)) {
return attribute.value;
else {
if (attribute.key.contains(attributeName)) {
return attribute.value;
}
}
}
}