We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ae8bc3 commit 1898697Copy full SHA for 1898697
1 file changed
src/main/java/org/htmlunit/javascript/host/dom/NodeList.java
@@ -152,6 +152,10 @@ public void forEach(final Object callback) {
152
"Foreach callback '" + JavaScriptEngine.toString(callback) + "' is not a function");
153
}
154
155
+ if (getElements().size() == 0) {
156
+ return;
157
+ }
158
+
159
final WebClient client = getWindow().getWebWindow().getWebClient();
160
final HtmlUnitContextFactory cf = client.getJavaScriptEngine().getContextFactory();
161
0 commit comments