Skip to content

NullPointerException in handleJavaScriptException #136

@jeffcjohnson

Description

@jeffcjohnson

I get the following NPE with HtmlUnit. I'm hoping the fix will be obvious to someone that knows the code well. If not I can try to come up with a way to reproduce it.

Thanks!

2020-02-17 15:29:15,504 ERROR [com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl] Job run failed with unexpected RuntimeException: null
java.lang.NullPointerException: null
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.handleJavaScriptException(JavaScriptEngine.java:984) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:886) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:624) ~[htmlunit-core-js-2.37.0.jar:?]
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:537) ~[htmlunit-core-js-2.37.0.jar:?]
	at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:354) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:815) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.setState(XMLHttpRequest.java:211) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.doSend(XMLHttpRequest.java:785) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.access$000(XMLHttpRequest.java:103) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest$1.run(XMLHttpRequest.java:634) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:624) ~[htmlunit-core-js-2.37.0.jar:?]
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:537) ~[htmlunit-core-js-2.37.0.jar:?]
	at com.gargoylesoftware.htmlunit.javascript.background.JavascriptXMLHttpRequestJob.run(JavascriptXMLHttpRequestJob.java:36) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:424) [htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at com.gargoylesoftware.htmlunit.javascript.background.DefaultJavaScriptExecutor.run(DefaultJavaScriptExecutor.java:148) [htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions