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 dd256b2 commit 4a44332
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 @@ -414,6 +414,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 4a44332

Please sign in to comment.