diff options
author | JH Choi <jjie.choi@samsung.com> | 2017-07-27 13:55:20 +0900 |
---|---|---|
committer | JH Choi <jjie.choi@samsung.com> | 2017-07-27 17:24:28 +0900 |
commit | e6f39aabcc61cb45772d2ad0bd675d71e170f943 (patch) | |
tree | db28879a8ba187e9e5b5bc0f8645eb2bfecfe993 | |
parent | b5023b745d63b656461d8256556b6fc34338f57f (diff) | |
download | home-e6f39aabcc61cb45772d2ad0bd675d71e170f943.tar.gz home-e6f39aabcc61cb45772d2ad0bd675d71e170f943.tar.bz2 home-e6f39aabcc61cb45772d2ad0bd675d71e170f943.zip |
SVACE issues fixed. (DEREF_OF_NULL_RET.LIB.PROC)
Change-Id: I752cd48acc67a0b1482700ebf8397acdd250aaa6
Signed-off-by: JH Choi <jjie.choi@samsung.com>
-rwxr-xr-x | LibTVRefCommonTizen/Ports/ApplicationManagerPort.cs | 2 | ||||
-rw-r--r-- | LibTVRefCommonTizen/Ports/PackageManagerPort.cs | 23 |
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) { |