From e66fe928e5709818dea2f985086df0c7e6e18167 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 3 Mar 2026 08:13:55 +0900 Subject: [PATCH] debugger_dap: Add null check to add_page_to_array() This fixes a crash when inspecting an empty array with the `variables` command. --- src/debugger_dap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/debugger_dap.c b/src/debugger_dap.c index fae23a4..9aa973c 100644 --- a/src/debugger_dap.c +++ b/src/debugger_dap.c @@ -411,6 +411,8 @@ static void add_array_elements_to_array(cJSON *array, struct page *page) static void add_page_to_array(cJSON *array, struct page *page) { + if (!page) + return; switch (page->type) { case GLOBAL_PAGE: add_globals_to_array(array, page);