Skip to content

Commit

Permalink
Gracefully handle null in checkSettingsForTerminalDeprecation
Browse files Browse the repository at this point in the history
Fixes a test failure after backport to 7.x
  • Loading branch information
ywelsch committed Aug 12, 2020
1 parent 37be78b commit a1eb327
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,16 @@ private static void checkSettingsForTerminalDeprecation(final Settings.Builder o
// 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.");
}
}
}
}
Expand Down

0 comments on commit a1eb327

Please sign in to comment.