SVACE issues fixed. (DEREF_OF_NULL_RET.LIB.PROC) 54/140954/1
authorJH Choi <jjie.choi@samsung.com>
Thu, 27 Jul 2017 04:55:20 +0000 (13:55 +0900)
committerJH Choi <jjie.choi@samsung.com>
Thu, 27 Jul 2017 08:24:28 +0000 (17:24 +0900)
Change-Id: I752cd48acc67a0b1482700ebf8397acdd250aaa6
Signed-off-by: JH Choi <jjie.choi@samsung.com>
LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs
LibTVRefCommonTizen/Ports/PackageManagerPort.cs

index d5621fd..29511ef 100755 (executable)
@@ -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;
                 }
index dff72d8..4004d1d 100644 (file)
@@ -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)
                 {