Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix [JENKINS-43630] - NPE if remote URL is null
Nothing to normalize if the remote URL is null.
  • Loading branch information
MarkEWaite committed Apr 17, 2017
1 parent c3d75a6 commit 44da1a4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/hudson/plugins/git/util/BuildData.java
Expand Up @@ -303,6 +303,9 @@ public String toString() {
* @return normalized URL as a string
*/
private String normalize(String url) {
if (url == null) {
return null;
}
/* Remove trailing slashes and .git suffix from URL */
String normalized = url.replaceAll("/+$", "").replaceAll("[.]git$", "");
if (url.contains("://")) {
Expand Down

0 comments on commit 44da1a4

Please sign in to comment.