Fix crash when event callback is not set 66/73166/2 accepted/tizen/common/20160607.194653 accepted/tizen/ivi/20160607.235245 accepted/tizen/ivi/20160607.235333 accepted/tizen/mobile/20160607.235228 accepted/tizen/mobile/20160607.235305 accepted/tizen/tv/20160607.235241 accepted/tizen/tv/20160607.235324 accepted/tizen/wearable/20160607.235233 accepted/tizen/wearable/20160607.235314 submit/tizen/20160607.081957 submit/tizen/20160607.082137
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 7 Jun 2016 04:32:11 +0000 (13:32 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 7 Jun 2016 07:14:59 +0000 (16:14 +0900)
Change-Id: I660591bcfe8c30f62cd6c1700154d019d4e8c08e
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
client/src/pkgmgr.c

index d98862d..2766244 100644 (file)
@@ -399,7 +399,7 @@ static void __operation_callback(void *cb_data, uid_t target_uid,
        }
 
        /* call callback */
-       if (appid != NULL && strlen(appid) != 0) {
+       if (appid != NULL && strlen(appid) != 0 && cb_info->app_event_cb) {
                /* run app callback */
                if (pc->new_event_cb)
                        cb_info->app_event_cb(target_uid, cb_info->request_id,
@@ -409,7 +409,7 @@ static void __operation_callback(void *cb_data, uid_t target_uid,
                        cb_info->app_event_cb(target_uid, cb_info->request_id,
                                        pkg_type, pkgid, appid, key, val, NULL,
                                        cb_info->data);
-       } else {
+       } else if (cb_info->event_cb) {
                /* run pkg callback */
                if (pc->new_event_cb)
                        cb_info->event_cb(target_uid, cb_info->request_id,