Commit 45e07c2
CVE Bot
fix: handle empty BWC versions stream in AbstractYamlRestCompatTestPlugin
When building an elasticsearch docker image without the full BWC version
checkout (e.g. the upgrade-elasticsearch workflow), getBwcVersions().getUnreleased()
may return an empty list for the previous major version (getMajor() == currentMajor-1).
The call to .min().get() on an empty stream throws NoSuchElementException 'No value present'.
Fix by using .orElse(null) and returning early when no compatible BWC version is found.1 parent e31282d commit 45e07c2
File tree
1 file changed
+6
-1
lines changed- build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/compat/compat
1 file changed
+6
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
0 commit comments