From 7aef21db1446e20fb22941878bf1a95f607a4238 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Wed, 8 Apr 2020 11:27:00 +0900 Subject: [PATCH] Add error handling for NULL Change-Id: Ic8323552dfef9f5a6325404156fd5eec9477b493 --- ug-wifidirect/src/wfd_ug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index b8a1691..4db9230 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -600,8 +600,13 @@ static void on_message(ui_gadget_h ug, app_control_h msg, app_control_h control, if (msg) { app_control_get_extra_data(msg, "msg", &app_msg); - DBG(LOG_DEBUG, "Msg from app: %s", app_msg); + if (!app_msg) { + DBG(LOG_ERROR, "Failed to get app_msg"); + __FUNC_EXIT__; + return; + } + DBG(LOG_DEBUG, "Msg from app: %s", app_msg); if (!strcmp(app_msg, "destroy")) { if (!ugd->rename_popup) { DBG(LOG_INFO, "Destroying UG."); -- 2.7.4