This repository was archived by the owner on Apr 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
jwebunit-httpunit-plugin/src/main/java/net/sourceforge/jwebunit/httpunit Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments