monitor: Fix crash when there is no write handler
authorSimon Mikuda <simon.mikuda@streamunlimited.com>
Thu, 23 Mar 2023 10:28:57 +0000 (11:28 +0100)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:41:34 +0000 (16:11 +0530)
monitor/att.c

index 313ac91..cd319cf 100644 (file)
@@ -2945,7 +2945,7 @@ static void print_write(const struct l2cap_frame *frame, uint16_t handle,
                return;
 
        handler = get_handler(attr);
-       if (!handler)
+       if (!handler || !handler->write)
                return;
 
        handler->write(frame);