Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Null pointer exceptions #161

Merged
merged 3 commits into from
Jan 6, 2021
Merged

Fix Null pointer exceptions #161

merged 3 commits into from
Jan 6, 2021

Conversation

res0nance
Copy link
Contributor

@res0nance res0nance commented Dec 31, 2020

@res0nance
Copy link
Contributor Author

CC: @olamy
Probably should add this bit if releasing as this takes care of some edge cases causing null pointers to be produced

listener.getLogger().println("Skipping " + HyperlinkNote.encodeTo('/'+ p.getUrl(), p.getFullDisplayName()) +
". The project is either disabled,"
+ " or the authenticated user " + ModelHyperlinkNote.encodeTo(User.current()) + " has no Item.BUILD permissions,"
+ " or the authenticated user " + userName + " has no Item.BUILD permissions,"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the authenticated user unknown has no ..." is a bit odd, but should be ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be the authenticated user unknown has no Item.BUILD

@@ -151,7 +154,10 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
BuildInfoExporterAction.addBuildInfoExporterAction(build, completedRun.getParent().getFullName(), completedRun.getNumber(), completedRun.getResult());

if (buildStepResult && config.getBlock().mapBuildStepResult(completedRun.getResult())) {
build.setResult(config.getBlock().mapBuildResult(completedRun.getResult()));
Result r = config.getBlock().mapBuildResult(completedRun.getResult());
if (r != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r == null when the run is not finished.
Maybe it makes sense to add a system warning for the edge case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I can add it in case there is some underlying issue here

@oleg-nenashev oleg-nenashev merged commit e2958dc into jenkinsci:master Jan 6, 2021
@res0nance res0nance deleted the npe branch January 10, 2021 16:46
hashar added a commit to hashar/parameterized-trigger-plugin that referenced this pull request Apr 10, 2024
I keep having log messages such as:

  WARNING: [hudson.plugins.parameterizedtrigger.TriggerBuilder perform]
  Attempting to use the result of unfinished build <name of job> #1234

The message was introduced in jenkinsci#161 by 06d8f19 but in jenkinsci#148 / 02ee6ea,
mapBuildResult() was made to return `null` by default (eg on SUCCESS).

The resut is the warning is always triggered when the triggered build
succeeds.

Fixes https://phabricator.wikimedia.org/T336782
MarkEWaite added a commit that referenced this pull request May 7, 2024
I keep having log messages such as:

  WARNING: [hudson.plugins.parameterizedtrigger.TriggerBuilder perform]
  Attempting to use the result of unfinished build <name of job> #1234

The message was introduced in #161 by 06d8f19 but in #148 / 02ee6ea,
mapBuildResult() was made to return `null` by default (eg on SUCCESS).

The resut is the warning is always triggered when the triggered build
succeeds.

Fixes https://phabricator.wikimedia.org/T336782

Co-authored-by: Mark Waite <[email protected]>
Co-authored-by: Bruno Verachten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants