Bug-fix: fix target dll searching logic
[platform/core/dotnet/launcher.git] / NativeLauncher / installer-plugin / prefer_nuget_cache_plugin.cc
index 02de1f4..ab93bce 100644 (file)
@@ -17,6 +17,7 @@
 #include "tac_installer.h"
 
 #include <glib.h>
+#include <string>
 
 #ifdef  LOG_TAG
 #undef  LOG_TAG
 
 extern "C" int PKGMGR_MDPARSER_PLUGIN_INSTALL(const char *pkgId, const char *appId, GList *list)
 {
+       if (pkgId == NULL || appId == NULL) {
+               return 0;
+       }
        return tacInstall(std::string(pkgId), TAC_STATE_INSTALL);
 }
 
 extern "C" int PKGMGR_MDPARSER_PLUGIN_UPGRADE(const char *pkgId, const char *appId, GList *list)
 {
+       if (pkgId == NULL || appId == NULL) {
+               return 0;
+       }
        return tacUpgrade(std::string(pkgId), TAC_STATE_UPGRADE);
 }
 
 extern "C" int PKGMGR_MDPARSER_PLUGIN_UNINSTALL(const char *pkgId, const char *appId, GList *list)
 {
+       if (pkgId == NULL || appId == NULL) {
+               return 0;
+       }
        return tacUninstall(std::string(pkgId), TAC_STATE_UNINSTALL);
 }
 
 extern "C" int PKGMGR_MDPARSER_PLUGIN_REMOVED(const char *pkgId, const char *appId, GList *list)
 {
+       if (pkgId == NULL || appId == NULL) {
+               return 0;
+       }
        return tacRemoved(std::string(pkgId));
 }
 
 extern "C" int PKGMGR_MDPARSER_PLUGIN_UNDO(const char *pkgId, const char *appId, GList *list)
 {
+       if (pkgId == NULL || appId == NULL) {
+               return 0;
+       }
        return tacUndo(std::string(pkgId));
 }
 
 extern "C" int PKGMGR_MDPARSER_PLUGIN_CLEAN(const char *pkgId, const char *appId, GList *list)
 {
+       if (pkgId == NULL || appId == NULL) {
+               return 0;
+       }
        return tacClean(std::string(pkgId));
 }