Skip to content

Commit 4145aaf

Browse files
committed
Ignore invalid limits, rather than failing
Otherwise, we can wind up in a situation where the entire UI fails to launch just because an invalid limit is being set during startup. Thanks to Gabe Selzer for finding this.
1 parent b4a6684 commit 4145aaf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/org/scijava/ui/swing/search/SwingSearchBar.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ public int getResultLimit() {
204204

205205
/** Sets the maximum number of results per search category. */
206206
public void setResultLimit(final int resultLimit) {
207-
if (resultLimit <= 0) {
208-
throw new IllegalArgumentException("Limit must be positive");
209-
}
207+
if (resultLimit <= 0) return; // Ignore invalid limit.
210208
this.resultLimit = resultLimit;
211209
}
212210

0 commit comments

Comments
 (0)