const char* appId, const char* pkgId,
const char* pkgType, void* userData) -> int {
WITH_SELF(userData) {
- self->appInfo.root = std::string(aul_get_app_root_path());
+ const char* appRootPath = aul_get_app_root_path();
+ if (appRootPath != nullptr) {
+ self->appInfo.root = std::string(appRootPath);
+ }
self->appInfo.path = appPath;
self->appInfo.id = appId;
self->appInfo.pkg = pkgId;
_DBG("pkg : %s", appInfo.pkg.c_str());
_DBG("type : %s", appInfo.type.c_str());
- // The launchpad pass the name of exe file to the first argument.
- // For the C# spec, we have to skip this first argument.
-
- if (runtime->launch(appInfo.id.c_str(), appInfo.root.c_str(), appInfo.path.c_str(), argc-1, argv+1))
- _ERR("Failed to launch");
+ // aul_get_app_root_path() can return NULL for error case.
+ if (appInfo.root.empty()) {
+ _ERR("Failed to launch. root path is set to NULL");
+ } else {
+ // The launchpad pass the name of exe file to the first argument.
+ // For the C# spec, we have to skip this first argument.
+ if (runtime->launch(appInfo.id.c_str(), appInfo.root.c_str(), appInfo.path.c_str(), argc-1, argv+1))
+ _ERR("Failed to launch");
+ }
};
int ret = Launchpad.loaderMain(argc, argv);
if (ret < 0) {