@@ -157,22 +157,32 @@ private static void searchRepeaterTabsForString(String search) {
157157 JTabbedPane repeaterTabs = ExtensionState .getInstance ().getRepeaterTabbedPane ();
158158 ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput ("Searching for: " +search );
159159 for ( int i =0 ; i < repeaterTabs .getTabCount (); i ++) {
160- repeaterTabs .setBackgroundAt (i ,new Color (0xBBBBBB ));
161- List <Component > repeaterTabRequestResponseJTextAreas = BurpGuiControl .findAllComponentsOfType ((Container ) repeaterTabs .getComponentAt (i ), JTextArea .class );
162-
163- if ( searchRequestForText ) {
164- JTextArea requestTextArea = (JTextArea ) repeaterTabRequestResponseJTextAreas .get (0 );
165- ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput (requestTextArea .getText ());
166- if (searchTextArea (search ,requestTextArea ) ) {
167- repeaterTabs .setBackgroundAt (i ,new Color (0xff6633 ));
168- }
169- }
170- if ( searchResponseForText ) {
171- JTextArea responseTextArea = (JTextArea ) repeaterTabRequestResponseJTextAreas .get (1 );
172- ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput (responseTextArea .getText ());
173- if (searchTextArea (search , responseTextArea )) {
174- repeaterTabs .setBackgroundAt (i ,new Color (0xff6633 ));
175- }
160+ if (repeaterTabs .getComponentAt (i ) != null ) {
161+ repeaterTabs .setBackgroundAt (i , new Color (0xBBBBBB ));
162+ List <Component > repeaterTabRequestResponseJTextAreas = BurpGuiControl .findAllComponentsOfType ((Container ) repeaterTabs .getComponentAt (i ), JTextArea .class );
163+ ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput ("jtextarea count: " +repeaterTabRequestResponseJTextAreas .size ());
164+ if (searchRequestForText ) {
165+ JTextArea requestTextArea = (JTextArea ) repeaterTabRequestResponseJTextAreas .get (0 );
166+ if (searchTextArea (search , requestTextArea )) {
167+ ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput (requestTextArea .getText ());
168+ repeaterTabs .setBackgroundAt (i , new Color (0xff6633 ));
169+ }
170+ }
171+ if (searchResponseForText ) {
172+ for (int x = 1 ; x <repeaterTabRequestResponseJTextAreas .size ();x ++){
173+ if (((JTextArea )repeaterTabRequestResponseJTextAreas .get (x )).getText ().length () != 0 ) {
174+ ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput ("searching response" );
175+ JTextArea responseTextArea = (JTextArea ) repeaterTabRequestResponseJTextAreas .get (1 );
176+ ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput (responseTextArea .getText ());
177+ if (searchTextArea (search , responseTextArea )) {
178+ ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput ("found in response" );
179+ ExtensionState .getInstance ().getCallbacks ().logging ().logToOutput (responseTextArea .getText ());
180+ repeaterTabs .setBackgroundAt (i , new Color (0xff6633 ));
181+ }
182+ break ;
183+ }
184+ }
185+ }
176186 }
177187 }
178188 }
0 commit comments