Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-20201]
I'm actually unclear why bindJSON can return null at all.
But I'm not going to let that mystery block users.
  • Loading branch information
kohsuke committed Jun 8, 2014
1 parent 4ceecec commit e46663b
Showing 1 changed file with 12 additions and 14 deletions.
Expand Up @@ -77,20 +77,18 @@ public String getDisplayName() {
}

@Override
public JobProperty<?> newInstance(StaplerRequest req,
JSONObject formData) throws FormException {
GithubProjectProperty tpp = req.bindJSON(
GithubProjectProperty.class, formData);

if(tpp == null){
LOGGER.info("Couldn't bind JSON");
return null;
}
if (tpp.projectUrl == null) {
tpp = null; // not configured
LOGGER.info("projectUrl not found, nullifying GithubProjectProperty");
}
return tpp;
public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
GithubProjectProperty tpp = req.bindJSON(GithubProjectProperty.class, formData);

if (tpp == null) {
LOGGER.fine("Couldn't bind JSON");
return null;
}
if (tpp.projectUrl == null) {
tpp = null; // not configured
LOGGER.fine("projectUrl not found, nullifying GithubProjectProperty");
}
return tpp;
}

}
Expand Down

0 comments on commit e46663b

Please sign in to comment.