In browsers, a JavaScript call to aDiv.getAttribute('title') when 'title'
isn't an attribute of aDiv returns null (see attached HTML file for an
example). HtmlUnit, however, returns an empty string ("") in this
scenario. Unfortunately, there seems to be many places in the
HtmlUnit code that throw NPEs when the result of the call to
HtmlElement#getAttributeValue() returns null (see
com.gargoylesoftware.htmlunit.javascript.host.Style, lines 165-166).
Sample HTML file showing the browser returning null for a call to getAttribute() where the attribute isn't defined in the element.
Logged In: YES
user_id=402164
Fixed at js level HTMLElement.jsFunction_getAttribute.