SRADA-772: Fixed NullPointerException in PathManager.getTizenSdkInstallPath().
authorMaria Guseva <m.guseva@samsung.com>
Wed, 8 Jun 2016 11:22:17 +0000 (14:22 +0300)
committerMaria Guseva <m.guseva@samsung.com>
Fri, 1 Jul 2016 08:24:03 +0000 (17:24 +0900)
The exception occured in unit tests for CLI after changes applied
in previous commit. When SDK installation is not found the
InstallPathConfig.getSDKPath() returns null but it isn't checked properly
in PathManager.getTizenSdkInstallPath(). In that case it should also return
null.

Change-Id: Ic503d836318ad2f2bbd02d5df9eaa187d79c15ba

org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/common/path/PathManager.java

index e499504..5b37291 100644 (file)
@@ -117,9 +117,11 @@ public class PathManager {
 
                defaultPath = InstallPathConfig.getSDKPath();
 
-               File file = new File(defaultPath);
-               if (file == null || !file.exists()) {
-                       defaultPath = null;
+               if (defaultPath != null) {
+                       File file = new File(defaultPath);
+                       if (file == null || !file.exists()) {
+                               defaultPath = null;
+                       }
                }
 
                return defaultPath;