From ea448ed69acfb6392fe8974aef7fadd95905c1cf Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Wed, 5 Oct 2022 14:46:13 +0200 Subject: [PATCH] Bluetooth: Audio: add check for default_conn for `audio qos` shell command Add a missing NULL check for the command. Signed-off-by: Emil Gydesen --- subsys/bluetooth/shell/audio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subsys/bluetooth/shell/audio.c b/subsys/bluetooth/shell/audio.c index 6c4311b94da..0253ea10009 100644 --- a/subsys/bluetooth/shell/audio.c +++ b/subsys/bluetooth/shell/audio.c @@ -1015,6 +1015,11 @@ static int cmd_qos(const struct shell *sh, size_t argc, char *argv[]) return -ENOEXEC; } + if (default_conn == NULL) { + shell_error(sh, "Not connected"); + return -ENOEXEC; + } + named_preset = default_preset; if (argc > 1) {