Don't check if multi handle is nullptr 21/214821/1
authormk5004.lee <mk5004.lee@samsung.com>
Fri, 27 Sep 2019 00:31:48 +0000 (09:31 +0900)
committermk5004.lee <mk5004.lee@samsung.com>
Fri, 27 Sep 2019 00:31:48 +0000 (09:31 +0900)
- for set_multi_language_title

Change-Id: Ib1b3abf64e682e7adeeeb8b0cb514b524156da9b
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
notification-ex/stub.cc

index 5b77758..3913290 100644 (file)
@@ -602,7 +602,7 @@ extern "C" EXPORT_API int noti_ex_item_checkbox_get_title(noti_ex_item_h handle,
 
 extern "C" EXPORT_API int noti_ex_item_checkbox_set_multi_language_title(
     noti_ex_item_h handle, noti_ex_multi_lang_h multi) {
-  if (handle == nullptr || multi == nullptr) {
+  if (handle == nullptr) {
     LOGE("Invalid parameter");
     return NOTI_EX_ERROR_INVALID_PARAMETER;
   }
@@ -713,7 +713,7 @@ extern "C" EXPORT_API int noti_ex_item_entry_set_text(noti_ex_item_h handle,
 
 extern "C" EXPORT_API int noti_ex_item_entry_set_multi_language(
     noti_ex_item_h handle, noti_ex_multi_lang_h multi) {
-  if (handle == nullptr || multi == nullptr) {
+  if (handle == nullptr) {
     LOGE("Invalid parameter");
     return NOTI_EX_ERROR_INVALID_PARAMETER;
   }
@@ -724,9 +724,14 @@ extern "C" EXPORT_API int noti_ex_item_entry_set_multi_language(
     return NOTI_EX_ERROR_INVALID_PARAMETER;
   }
 
+  EntryItem* ei = static_cast<EntryItem*>(p->Get());
+  if (multi == nullptr) {
+    ei->SetMultiLanguage(nullptr);
+    return NOTI_EX_ERROR_NONE;
+  }
+
   shared_ptr<MultiLanguage> mul_ptr =
       *reinterpret_cast<shared_ptr<MultiLanguage>*>(multi);
-  EntryItem* ei = static_cast<EntryItem*>(p->Get());
   ei->SetMultiLanguage(mul_ptr);
   ei->GetMultiLanguage()->UpdateString();