Fix bugs related to object creation
authorJusung Son <jusung07.son@samsung.com>
Fri, 14 Jun 2019 07:29:24 +0000 (16:29 +0900)
committerJusung Son <jusung07.son@samsung.com>
Fri, 12 Jul 2019 01:08:35 +0000 (10:08 +0900)
Change-Id: I472f2826ccc2f9c5a0ca6b9e5f379a0444c1d3f1
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
notification-ex/stub.cc

index 265b966122b72a44a04e658d0420b60e52a0ad7f..712e279bb959687c5b395c8fc9f6b5957b8b3726 100644 (file)
@@ -2175,7 +2175,7 @@ extern "C" EXPORT_API int noti_ex_item_progress_create(noti_ex_item_h *handle,
     return NOTI_EX_ERROR_OUT_OF_MEMORY;
   }
 
-  *handle = new Handle(p);
+  *handle = new Handle(shared_ptr<AbstractItem>(p));
 
   return NOTI_EX_ERROR_NONE;
 }
@@ -2424,7 +2424,7 @@ extern "C" EXPORT_API int noti_ex_reporter_find_by_root_id(
 
 extern "C" EXPORT_API int noti_ex_item_text_create(noti_ex_item_h *handle,
     const char *id, const char *text, const char *hyperlink) {
-  if (handle == nullptr) {
+  if (handle == nullptr || text == nullptr) {
     LOGE("Invalid parameter");
     return NOTI_EX_ERROR_INVALID_PARAMETER;
   }
@@ -2449,7 +2449,7 @@ extern "C" EXPORT_API int noti_ex_item_text_create(noti_ex_item_h *handle,
 
 extern "C" EXPORT_API int noti_ex_item_text_set_contents(noti_ex_item_h handle,
     const char *contents) {
-  if (handle == nullptr) {
+  if (handle == nullptr || contents == nullptr) {
     LOGE("Invalid parameter");
     return NOTI_EX_ERROR_INVALID_PARAMETER;
   }