Gracefully handle null in checkSettingsForTerminalDeprecation

Fixes a test failure after backport to 7.x
This commit is contained in:
Yannick Welsch 2020-08-12 18:03:52 +02:00
parent 14e1618fd9
commit 8c488de576
1 changed files with 10 additions and 7 deletions

View File

@ -116,13 +116,16 @@ public class InternalSettingsPreparer {
// This method to be removed in 8.0.0, as it was deprecated in 6.0 and removed in 7.0
assert Version.CURRENT.major != 8: "Logic pertaining to config driven prompting should be removed";
for (String setting : output.keys()) {
switch (output.get(setting)) {
case SECRET_PROMPT_VALUE:
throw new SettingsException("Config driven secret prompting was deprecated in 6.0.0. Use the keystore" +
" for secure settings.");
case TEXT_PROMPT_VALUE:
throw new SettingsException("Config driven text prompting was deprecated in 6.0.0. Use the keystore" +
" for secure settings.");
final String value = output.get(setting);
if (value != null) {
switch (value) {
case SECRET_PROMPT_VALUE:
throw new SettingsException("Config driven secret prompting was deprecated in 6.0.0. Use the keystore" +
" for secure settings.");
case TEXT_PROMPT_VALUE:
throw new SettingsException("Config driven text prompting was deprecated in 6.0.0. Use the keystore" +
" for secure settings.");
}
}
}
}