From a09b89b36d9f103f097645e8d02a60f2c615d413 Mon Sep 17 00:00:00 2001 From: idrey Date: Tue, 13 Jun 2023 20:33:57 +0800 Subject: [PATCH] fix proto cmd crash problem in iperf example --- examples/common_components/iperf/wifi_cmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/common_components/iperf/wifi_cmd.c b/examples/common_components/iperf/wifi_cmd.c index 6c08d28207..a57428f930 100644 --- a/examples/common_components/iperf/wifi_cmd.c +++ b/examples/common_components/iperf/wifi_cmd.c @@ -670,6 +670,10 @@ static int wifi_cmd_proto(int argc, char **argv) } wifi_mode_t mode; esp_wifi_get_mode(&mode); + if(WIFI_MODE_NULL == mode) { + ESP_LOGI(TAG, "current wifi mode is null"); + return 1; + } int ifx = (WIFI_MODE_STA == mode) ? 0 : 1; if (proto_args.proto->count) { if (!strcmp(proto_args.proto->sval[0], "ax")) {