From: Seungha Son Date: Fri, 9 Jun 2017 10:54:53 +0000 (+0900) Subject: Arranges null check X-Git-Tag: accepted/tizen/unified/20170613.194234~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfa0dabd066e773b7e13d57d009262d249bb258c;p=platform%2Fcore%2Fapi%2Fnotification.git Arranges null check Signed-off-by: Seungha Son Change-Id: I9f868abeedf222a560ca570c0906b053e73ebb44 --- diff --git a/src/notification.c b/src/notification.c index 0ce1e28..b60b6a2 100755 --- a/src/notification.c +++ b/src/notification.c @@ -849,10 +849,7 @@ EXPORT_API int notification_set_time_to_text(notification_h noti, notification_t char buf[256] = { 0, }; char buf_tag[512] = { 0, }; - if (noti == NULL) - return NOTIFICATION_ERROR_INVALID_PARAMETER; - - if (time <= 0) + if (noti == NULL || time <= 0) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_TEXT_TYPE_NONE @@ -875,10 +872,7 @@ EXPORT_API int notification_get_time_from_text(notification_h noti, notification char *ret_text = NULL; char *tag_value; - if (noti == NULL) - return NOTIFICATION_ERROR_INVALID_PARAMETER; - - if (time == NULL) + if (noti == NULL || time == NULL) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_TEXT_TYPE_NONE @@ -886,7 +880,6 @@ EXPORT_API int notification_get_time_from_text(notification_h noti, notification return NOTIFICATION_ERROR_INVALID_PARAMETER; ret = notification_get_text(noti, type, &ret_text); - if (ret != NOTIFICATION_ERROR_NONE || ret_text == NULL) return NOTIFICATION_ERROR_INVALID_PARAMETER; @@ -1102,10 +1095,7 @@ EXPORT_API int notification_get_launch_option(notification_h noti, app_control_h *app_control = (app_control_h *)option; app_control_h app_control_new = NULL; - if (noti == NULL) - return NOTIFICATION_ERROR_INVALID_PARAMETER; - - if (app_control == NULL) + if (noti == NULL || app_control == NULL) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) @@ -1176,13 +1166,7 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_ bundle *b = NULL; app_control_h app_control_new = NULL; - if (noti == NULL) { - err = NOTIFICATION_ERROR_INVALID_PARAMETER; - NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); - goto out; - } - - if (event_handler == NULL) { + if (noti == NULL || event_handler == NULL) { err = NOTIFICATION_ERROR_INVALID_PARAMETER; NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER"); goto out;