Skip to content

Commit

Permalink
[Fix JENKINS-25313] avoid null pointer if repository not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Oct 29, 2014
1 parent d66aef7 commit d4dda4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -392,6 +392,10 @@ public RemoteConfig getRepositoryByName(String repoName) {

@Exported
public List<UserRemoteConfig> getUserRemoteConfigs() {
if (userRemoteConfigs == null) {
/* Prevent NPE when no remote config defined */
userRemoteConfigs = new ArrayList<UserRemoteConfig>();
}
return Collections.unmodifiableList(userRemoteConfigs);
}

Expand Down

0 comments on commit d4dda4b

Please sign in to comment.