summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLibTVRefCommonTizen/Ports/ApplicationManagerPort.cs2
-rw-r--r--LibTVRefCommonTizen/Ports/PackageManagerPort.cs23
2 files changed, 21 insertions, 4 deletions
diff --git a/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs b/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs
index d5621fd..29511ef 100755
--- a/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs
+++ b/LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs
@@ -258,7 +258,7 @@ namespace LibTVRefCommonTizen.Ports
foreach (var app in installedList)
{
- if (app.Label.Equals(appLabel))
+ if (app != null && app.Label.Equals(appLabel))
{
return app.ApplicationId;
}
diff --git a/LibTVRefCommonTizen/Ports/PackageManagerPort.cs b/LibTVRefCommonTizen/Ports/PackageManagerPort.cs
index dff72d8..4004d1d 100644
--- a/LibTVRefCommonTizen/Ports/PackageManagerPort.cs
+++ b/LibTVRefCommonTizen/Ports/PackageManagerPort.cs
@@ -143,7 +143,14 @@ namespace LibTVRefCommonTizen.Ports
{
Package tempItem = PackageManager.GetPackage(pkgID);
- return tempItem.Label;
+ if(tempItem == null)
+ {
+ return null;
+ }
+ else
+ {
+ return tempItem.Label;
+ }
}
catch (Exception e)
{
@@ -182,8 +189,14 @@ namespace LibTVRefCommonTizen.Ports
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)
{
@@ -227,6 +240,10 @@ namespace LibTVRefCommonTizen.Ports
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)
{