Skip to content

Commit 3d35507

Browse files
committed
make nullable
1 parent 1b727f6 commit 3d35507

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/org/labkey/test/components/react/FilteringReactSelect.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@
44
*/
55
package org.labkey.test.components.react;
66

7+
import org.jetbrains.annotations.Nullable;
78
import org.labkey.test.Locator;
89
import org.labkey.test.WebDriverWrapper;
910
import org.openqa.selenium.NoSuchElementException;
10-
import org.openqa.selenium.SearchContext;
1111
import org.openqa.selenium.StaleElementReferenceException;
1212
import org.openqa.selenium.WebDriver;
1313
import org.openqa.selenium.WebElement;
1414
import org.openqa.selenium.support.ui.ExpectedConditions;
15-
import org.openqa.selenium.support.ui.FluentWait;
1615

17-
import java.time.Duration;
1816
import java.util.List;
1917

2018
import static org.labkey.test.BaseWebDriverTest.WAIT_FOR_JAVASCRIPT;
@@ -117,7 +115,7 @@ public FilteringReactSelect filterSelect(String value) // adds text for usage in
117115

118116
/* for use with editable instances of a reactSelect, where the options aren't shown
119117
unless type-ahead filter information is keyed in first */
120-
public FilteringReactSelect filterSelect(String value, Locator elementToWaitFor)
118+
public FilteringReactSelect filterSelect(String value, @Nullable Locator elementToWaitFor)
121119
{
122120
waitForReady();
123121
scrollIntoView();
@@ -148,7 +146,8 @@ public FilteringReactSelect filterSelect(String value, Locator elementToWaitFor)
148146
}
149147
}, "failed to select item " + elemToClick.getAttribute("class") + " by clicking", WAIT_FOR_JAVASCRIPT);
150148

151-
elementToWaitFor.findElement(getComponentElement());
149+
if (elementToWaitFor != null)
150+
elementToWaitFor.findElement(getComponentElement());
152151

153152
close();
154153
return this;

0 commit comments

Comments
 (0)