Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

Commit

Permalink
lets avoid NPE for #53
Browse files Browse the repository at this point in the history
  • Loading branch information
jstrachan committed Sep 5, 2017
1 parent 653aca7 commit 0e6f8ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public void validate(UIValidationContext context) {
}
Iterator<GitRepositoryDTO> it = value.iterator();
String userNameSpace = KubernetesClientHelper.findDefaultNamespace(namespaces);
if (userNameSpace == null ) {
// Tenant not yet initialised properly!
return;
}
while (it.hasNext()) {
GitRepositoryDTO repo = it.next();
if (repo != null && repo.getName() != null) {
Expand All @@ -115,6 +119,7 @@ public void validate(UIValidationContext context) {
}
}


}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ public static String findDefaultNamespace(List<String> namespaces) {
return namespace;
}
}
if (namespaces.isEmpty()) {
return null;
}
return namespaces.get(0);
}

Expand Down

0 comments on commit 0e6f8ab

Please sign in to comment.