github-plugin
github-plugin copied to clipboard
Prevent stacktrace when there are no admin credentials
To keep logs cleaner
Instead of
Dec 10, 2016 10:31:51 PM WARNING org.jenkinsci.plugins.github.webhook.WebhookManager$2 applyNullSafe
Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=doublesharp,repository=PRIVATE_PROJECT]
java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=doublesharp,repository=PRIVATE_PROJECT]
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:156)
at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:152)
at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)
So it changes behaviour, now instead exception it will return null. May be good, but not sure how change will influence on plugins
btw, #206 may be related