Skip to content
Permalink
Browse files

avoid NPE in readFileFromWorkspace

[FIXES JENKINS-43537]
  • Loading branch information...
daspilker committed Apr 12, 2017
1 parent b5146c8 commit c5433982766b6d68a1cb85cd0f0832bfc194c6f0
@@ -29,6 +29,8 @@ Browse the Jenkins issue tracker to see any [open issues](https://issues.jenkins

## Release Notes
* 1.61 (unreleased)
* Fixed a problem with `readFileFromWorkspace`
([JENKINS-43537](https://issues.jenkins-ci.org/browse/JENKINS-43537))
* 1.60 (April 10 2017)
* Enabled script approval with the
[Script Security Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Script+Security+Plugin), see
@@ -263,14 +263,18 @@ public void queueJob(String path) throws NameNotProvidedException {

@Override
public InputStream streamFileInWorkspace(String relLocation) throws IOException, InterruptedException {
project.checkPermission(Item.WORKSPACE);
if (project != null) {
project.checkPermission(Item.WORKSPACE);
}
FilePath filePath = locateValidFileInWorkspace(workspace, relLocation);
return filePath.read();
}

@Override
public String readFileInWorkspace(String relLocation) throws IOException, InterruptedException {
project.checkPermission(Item.WORKSPACE);
if (project != null) {
project.checkPermission(Item.WORKSPACE);
}
FilePath filePath = locateValidFileInWorkspace(workspace, relLocation);
return filePath.readToString();
}

0 comments on commit c543398

Please sign in to comment.
You can’t perform that action at this time.