apache / apache/openwhisk

missing null check during TestUtils initialization

Open
#3,863 4 comments 0 reactions 0 assignees View on GitHub
bug question testing
Dominant language
Scala
Stars
6.8k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

in this method https://github.com/apache/incubator-openwhisk/blob/37ce9b86048dafb0f369a5a5b05caa0136a26ef4/tests/src/test/scala/common/WhiskProperties.java#L297 there's a missing null check:

```
public static File getVCAPServicesFile() {
String vcapServices = whiskProperties.getProperty("vcap.services.file");
if (vcapServices.startsWith(File.separator)) {
return new File(vcapServices);
} else {
return WhiskProperties.getFileRelativeToWhiskHome(vcapServices);
}
}
```

@jasonpet the `vcap` property does not appear to be used anymore in this repo:

https://github.com/apache/incubator-openwhisk/blob/9e5cec1f0e4b98c59e584d453b06a741be4a8c3b/tests/src/test/scala/common/TestUtils.java#L79

(per git blame https://github.com/apache/incubator-openwhisk/commit/f9b4f4841543ab27f4a7e974355802a811140483) is this used in the providers only now - if so i'm wondering if we can move it this code out.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.