While uninstalling a package, pkgmgr doesn't give the docPtr anymore.
So the plugin cannot parse the document anymore.
Now the plugin should validate the docPtr before try to parse it.
If the docPtr is NULL, skip to parse a document for safety.
Change-Id: Idaa6841e9c6068662d57832f4be99e1a3a9236f6
}
}
-
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 = ?";
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");