summaryrefslogtreecommitdiff
path: root/notification-ex
diff options
context:
space:
mode:
authormk5004.lee <mk5004.lee@samsung.com>2020-03-17 19:22:52 +0900
committermk5004.lee <mk5004.lee@samsung.com>2020-03-18 10:02:12 +0900
commit5964ecdc662682507f5f4a6e5cabc127093b5382 (patch)
tree7f4317b67de15c7ffdeb667cc2127bdce4ba610b /notification-ex
parent57a722a127605a8be6d3ae101cce8750637da2e1 (diff)
downloadnotification-5964ecdc662682507f5f4a6e5cabc127093b5382.tar.gz
notification-5964ecdc662682507f5f4a6e5cabc127093b5382.tar.bz2
notification-5964ecdc662682507f5f4a6e5cabc127093b5382.zip
Fix bug
- crash when chat_message_item's id is null get wrong event type from reporter event_cb Change-Id: Ia405484ad36a5348b68c0cda01feffc3ea0f4992 Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
Diffstat (limited to 'notification-ex')
-rw-r--r--notification-ex/ievent_info.h2
-rw-r--r--notification-ex/stub.cc12
2 files changed, 12 insertions, 2 deletions
diff --git a/notification-ex/ievent_info.h b/notification-ex/ievent_info.h
index e90dbaa..33986ef 100644
--- a/notification-ex/ievent_info.h
+++ b/notification-ex/ievent_info.h
@@ -35,8 +35,8 @@ class EXPORT_API IEventInfo {
Delete,
Get,
Error,
- Count,
DeleteAll,
+ Count,
Register,
Unregister,
Custom = 100
diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc
index 41269c3..82d79fe 100644
--- a/notification-ex/stub.cc
+++ b/notification-ex/stub.cc
@@ -484,6 +484,9 @@ extern "C" EXPORT_API int noti_ex_item_chat_message_create(
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
+ if (id == NULL)
+ id = "";
+
auto* p = new (std::nothrow) ChatMessageItem(id,
dynamic_pointer_cast<TextItem>(static_cast<Handle*>(name)->GetPtr()),
text == nullptr ? nullptr
@@ -612,6 +615,9 @@ extern "C" EXPORT_API int noti_ex_item_checkbox_create(noti_ex_item_h *handle,
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
+ if (id == NULL)
+ id = "";
+
p = new (std::nothrow) CheckBoxItem(id, title, checked);
if (p == nullptr) {
LOGE("Out-of-memory");
@@ -724,7 +730,11 @@ extern "C" EXPORT_API int noti_ex_item_entry_create(noti_ex_item_h *handle,
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
- p = new (std::nothrow) EntryItem(id);
+ if (id)
+ p = new (std::nothrow) EntryItem(id);
+ else
+ p = new (std::nothrow) EntryItem();
+
if (p == nullptr) {
LOGE("Out-of-memory");
return NOTI_EX_ERROR_OUT_OF_MEMORY;