Commits

Robert Massaioli [Atlassian] committed 91327de

CONNECT-105 - Small Refactor of CustomFieldHelper

  • Participants
  • Parent commits d442a4b
  • Branches CONNECT-105-allow-the-remote-user-to-be-customised

Comments (0)

Files changed (1)

src/main/java/com/atlassian/jconnect/jira/customfields/CustomFieldHelper.java

     static List<String> issueTypeIdsFor(Project project, IssueTypeSchemeManager issueTypeSchemeManager) {
         return transform(ImmutableList.copyOf(issueTypeSchemeManager.getIssueTypesForProject(project)), new Function<IssueType, String>() {
             public String apply(@Nullable IssueType from) {
-                return from.getId();
+                return from != null ? from.getId() : null;
             }
         });
     }
 
     public boolean containsField(Project project, BuiltInField field) {
         final CustomField fieldObjectByName = customFieldManager.getCustomFieldObjectByName(field.fieldName());
-        if(fieldObjectByName == null) return false;
-        return containsField(project, fieldObjectByName);
+        return fieldObjectByName != null && containsField(project, fieldObjectByName);
     }
 
     public boolean containsField(Project project, CustomField field)
     {
-        if (field == null)
-        {
-            return false;
-        }
-        
-        return field.isInScope(project, issueTypeIdsFor(project));
+        return field != null && field.isInScope(project, issueTypeIdsFor(project));
     }
 
     private List<String> issueTypeIdsFor(Project project) {