From 8bd30b062e383ae9c393d57f9817366fa3a02bd9 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 2 Jan 2024 20:09:34 +0900 Subject: [PATCH] handle null exception when printing protocol errors - Sometimes the interface obtained from wl_display_get_protocol_error is NULL when interface has already been destroyed. Change-Id: I0fe2fe9b759682078366bdc5fe4076e9f66a6d8a Signed-off-by: Joonbum Ko --- src/tpl_wl_egl_thread.c | 3 ++- src/tpl_wl_vk_thread.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index 8e2d576..5621065 100755 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -524,7 +524,8 @@ _wl_display_print_err(tpl_wl_egl_display_t *wl_egl_display, &err_interface, &err_proxy_id); TPL_ERR("[Protocol Error] interface: %s, error_code: %d, proxy_id: %d", - err_interface->name, err_code, err_proxy_id); + (err_interface ? err_interface->name : "UNKNOWN"), + err_code, err_proxy_id); } wl_egl_display->last_error = errno; diff --git a/src/tpl_wl_vk_thread.c b/src/tpl_wl_vk_thread.c index 319d339..48bf770 100644 --- a/src/tpl_wl_vk_thread.c +++ b/src/tpl_wl_vk_thread.c @@ -418,7 +418,8 @@ _wl_display_print_err(tpl_wl_vk_display_t *wl_vk_display, &err_interface, &err_proxy_id); TPL_ERR("[Protocol Error] interface: %s, error_code: %d, proxy_id: %d", - err_interface->name, err_code, err_proxy_id); + (err_interface ? err_interface->name : "UNKNOWN"), + err_code, err_proxy_id); } wl_vk_display->last_error = errno; -- 2.34.1