Skip to content

Commit

Permalink
Avoiding NPE #37
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Feb 7, 2018
1 parent f5ceefc commit 02c4d68
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Generic Webhook Plugin Changelog
Changelog of Generic Webhook Plugin.
## Unreleased
### GitHub [#37](https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/37) NullPointerException at GenericTriggerResults (version 1.25) *bug*

**Avoiding NPE #37**


[e904e3361b46c8b](https://github.com/jenkinsci/generic-webhook-trigger-plugin/commit/e904e3361b46c8b) Tomas Bjerre *2018-02-07 15:17:59*


## 1.25 (2018-02-06 19:45:30)
### GitHub [#35](https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/35) Add defaultValue attribute to GenericVariables *enhancement*

Expand Down
18 changes: 15 additions & 3 deletions src/main/java/org/jenkinsci/plugins/gwt/GenericTriggerResults.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,32 @@ public class GenericTriggerResults {
private final String searchUrl;
private final String url;
private final long id;
private boolean triggered;
private final boolean triggered;
private final String searchName;

public GenericTriggerResults(
hudson.model.Queue.Item item,
Map<String, String> resolvedVariables,
String regexpFilterText,
String regexpFilterExpression) {
if (item != null) {
this.searchUrl = item.getApi().getSearchUrl();
this.url = item.getUrl();
this.id = item.getId();
this.triggered = true;
} else {
this.searchUrl = null;
this.url = null;
this.id = 0;
this.triggered = false;
}

if (item != null && item.getApi() != null) {
this.searchUrl = item.getApi().getSearchUrl();
this.searchName = item.getApi().getSearchName();
} else {
this.searchUrl = null;
this.searchName = null;
}

this.resolvedVariables = resolvedVariables;
this.regexpFilterText = regexpFilterText;
this.regexpFilterExpression = regexpFilterExpression;
Expand Down Expand Up @@ -60,4 +68,8 @@ public String getRegexpFilterText() {
public Map<String, String> getResolvedVariables() {
return resolvedVariables;
}

public String getSearchName() {
return searchName;
}
}

0 comments on commit 02c4d68

Please sign in to comment.