diff --git a/src/protocol.cpp b/src/protocol.cpp index fa35e0f..eace564 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -550,8 +550,9 @@ bool process_server_state_controller(JsonObject root, // command is a non-compliant value rather than a forward-compatible one: drop and log it. if (controller_object["supported_commands"].is()) { std::vector commands; - for (JsonVariantConst command_var : - controller_object["supported_commands"].as()) { + JsonArrayConst commands_array = + controller_object["supported_commands"].as(); + for (JsonVariantConst command_var : commands_array) { if (auto command = read_enum_field(command_var, "supported_commands", controller_command_from_string)) { commands.push_back(*command);