Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2016-06-09 19:42:29 -0400
committerAngel Avila2016-06-09 19:42:29 -0400
commit80b18f92c6a612c884767cfe23e4b88cc391f62c (patch)
tree1465b6fce36fc2a83c657c3f6b723a25d816881d /plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse
parentde190f34a36b1df492bccec98d6e7a37baf79d5f (diff)
downloadorg.eclipse.osee-80b18f92c6a612c884767cfe23e4b88cc391f62c.tar.gz
org.eclipse.osee-80b18f92c6a612c884767cfe23e4b88cc391f62c.tar.xz
org.eclipse.osee-80b18f92c6a612c884767cfe23e4b88cc391f62c.zip
refactor[ats_ATS284247]: Add missing null checks
Signed-off-by: Morgan E. Cook <Morgan.e.cook@boeing.com> Change-Id: Ib9f7cd6fac1690741e653c574107a3a010390b44 Signed-off-by: Morgan E. Cook <Morgan.e.cook@boeing.com>
Diffstat (limited to 'plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java
index cc7cc8d7013..780d197d020 100644
--- a/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java
+++ b/plugins/org.eclipse.osee.ote.version.svn/src/org/eclipse/osee/ote/version/svn/ScriptToProject.java
@@ -28,21 +28,24 @@ public class ScriptToProject {
String scriptName = scriptFile.getName();
IProject scriptProject = null;
- for(IProject project:workspaceProjects){
+ for (IProject project : workspaceProjects) {
String projectName = project.getName();
- if(scriptFile.toString().contains(projectName)){
+ if (scriptFile.toString().contains(projectName)) {
scriptProject = project;
}
}
- URI scriptProjectLocationUri = scriptProject.getLocationURI();
+ URI scriptProjectLocationUri = null;
+ if (scriptProject != null) {
+ scriptProject.getLocationURI();
+ }
File scriptProjectFile = new File(scriptProjectLocationUri);
if (isSvn(scriptProjectFile)) {
String scriptProjectLocation = scriptProjectFile.getAbsolutePath();
addScriptListValue(scriptProjectLocation, scriptName);
scriptNameToScriptFileMap.put(scriptName, scriptFile);
- }
+ }
}
public Set<String> getProjectsSet() {
@@ -60,7 +63,7 @@ public class ScriptToProject {
public File getScriptFileMatch(String project, String itemToMatch) {
Set<String> scriptsForProject = projectsScriptsMap.get(project);
- if(scriptsForProject.contains(itemToMatch)){
+ if (scriptsForProject.contains(itemToMatch)) {
return scriptNameToScriptFileMap.get(itemToMatch);
} else {
return null;

Back to the top