Check the docPtr.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 14 Nov 2013 09:49:43 +0000 (18:49 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 14 Nov 2013 09:49:43 +0000 (18:49 +0900)
If it comes with NULL, do not try to parse it.
While uninstalling packages, the pkgmgr doesn't give the docPtr to the plugin.
So there is no way to parse the xml document.
Ignore it.

Change-Id: Ica97ce8335f9eb8ba557821e2c87560d9878a233

pkgmgr_shortcut/src/service_register.c

index 7b0b430..902c0a4 100644 (file)
@@ -374,7 +374,6 @@ static void do_upgrade_db_schema(void)
        }
 }
 
-
 static int db_remove_record(const char *pkgid, const char *appid, const char *key, const char *data)
 {
        static const char *dml = "DELETE FROM shortcut_service WHERE appid = ? AND extra_key = ? AND extra_data = ? AND pkgid = ?";
@@ -957,6 +956,11 @@ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *_appid)
        xmlNodePtr root;
        int id;
 
+       if (!docPtr) {
+               DbgPrint("Package manager doesn't support the docPtr (%s)\n", _appid);
+               return 0;
+       }
+
        root = xmlDocGetRootElement(docPtr);
        if (!root) {
                ErrPrint("Invalid node ptr\n");