From b6a70bd03709a69f0c0b062a32b2bb88f0d06bd3 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Wed, 19 Jun 2024 14:25:48 +0200 Subject: [PATCH] prevent exception in split when enter is pressed without any input in network (wifi) selection --- ESP32/main.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ESP32/main.ino b/ESP32/main.ino index f0a6ed3..c7728ad 100644 --- a/ESP32/main.ino +++ b/ESP32/main.ino @@ -152,6 +152,8 @@ void configure_network(console *const c) c->flush_input(); std::string wifi_ap = c->read_line("Enter SSID[|PSK]: "); + if (wifi_ap.empty()) + return; auto parts = split(wifi_ap, "|"); if (parts.size() > 2) {