Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit 1aeec14

Browse files
committed
Fix bug [ 1194792 ]
1 parent 2f280aa commit 1aeec14

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

jwebunit-httpunit-plugin/src/main/java/net/sourceforge/jwebunit/httpunit/HttpUnitDialog.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,15 @@ public boolean hasResetButton(String buttonName) {
649649
*/
650650
private Button getButton(String buttonId) {
651651
Button btn = null;
652-
try {
653-
WebForm[] forms = resp.getForms();
654-
for (int i = 0; i < forms.length; i++) {
655-
if ((btn = forms[i].getButtonWithID(buttonId)) != null)
656-
break;
657-
}
658-
} catch (SAXException e) {
659-
throw new RuntimeException(e);
652+
try {
653+
WebForm[] forms = resp.getForms();
654+
for (int i = 0; i < forms.length; i++) {
655+
if ((btn = forms[i].getButtonWithID(buttonId)) != null)
656+
break;
660657
}
658+
} catch (SAXException e) {
659+
throw new RuntimeException(e);
660+
}
661661
return btn;
662662
}
663663

@@ -1242,12 +1242,14 @@ public boolean matchesCriteria(Object found, Object given) {
12421242
Attr foundAttribute = (Attr) foundAttributes.item(i);
12431243
Attr givenAttribute = (Attr) givenAttributes
12441244
.getNamedItem(foundAttribute.getName());
1245+
if (givenAttribute == null) {
1246+
return false;
1247+
}
12451248
if (!foundAttribute.getValue()
12461249
.equals(givenAttribute.getValue())) {
12471250
return false;
12481251
}
12491252
}
1250-
12511253
return true;
12521254
}
12531255
}

0 commit comments

Comments
 (0)