sculpt_manager: check passphrase before ENTER

Prevent setting an invalid configuration by guarding against are
premature generation.

Issue #4858.
This commit is contained in:
Josef Söntgen 2023-05-03 19:49:05 +00:00 committed by Checker
parent f712d97763
commit eb93b5f863

View File

@ -38,8 +38,10 @@ void Sculpt::Network::handle_key_press(Codepoint code)
enum { BACKSPACE = 8, ENTER = 10 };
if (code.value == BACKSPACE)
wpa_passphrase.remove_last_character();
else if (code.value == ENTER)
else if (code.value == ENTER) {
if (wpa_passphrase.suitable_for_connect())
wifi_connect(dialog.selected_ap());
}
else if (code.valid())
wpa_passphrase.append_character(code);