Change-Id: I752cd48acc67a0b1482700ebf8397acdd250aaa6
Signed-off-by: JH Choi <jjie.choi@samsung.com>
foreach (var app in installedList)
{
- if (app.Label.Equals(appLabel))
+ if (app != null && app.Label.Equals(appLabel))
{
return app.ApplicationId;
}
{
Package tempItem = PackageManager.GetPackage(pkgID);
- return tempItem.Label;
+ if(tempItem == null)
+ {
+ return null;
+ }
+ else
+ {
+ return tempItem.Label;
+ }
}
catch (Exception e)
{
try
{
Package tempItem = PackageManager.GetPackage(pkgID);
-
- return PackageManager.Uninstall(tempItem.Id, tempItem.PackageType);
+ if(tempItem == null)
+ {
+ return false;
+ }
+ else
+ {
+ return PackageManager.Uninstall(tempItem.Id, tempItem.PackageType);
+ }
}
catch (Exception e)
{
int index = 0;
List<string> apps = new List<string>();
Package pkg = PackageManager.GetPackage(pkgID);
+ if(pkg == null)
+ {
+ return null;
+ }
IEnumerable<ApplicationInfo> appsList = pkg.GetApplications();
if (appsList == null)
{