diff --git a/src/HtmlParser.cc b/src/HtmlParser.cc
index 8ddb86ea..5451e700 100644
--- a/src/HtmlParser.cc
+++ b/src/HtmlParser.cc
@@ -48,12 +48,15 @@ HtmlParser::~HtmlParser()
namespace {
const char* get_attr(const xmlChar **attrs, const char *name)
{
+ if(attrs == nullptr) {
+ return nullptr;
+ }
for(; *attrs; attrs += 2) {
if(util::strieq(reinterpret_cast(attrs[0]), name)) {
return reinterpret_cast(attrs[1]);
}
}
- return 0;
+ return nullptr;
}
} // namespace