-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
Description
When we have all of the following conditions:
- we specify a relative path to the
manifest.yml
- the relative path has only one segment (e.g. "manifest.yml" in the current dir)
- the manifest has a
path
attribute
Then the parser utility crashes with NPE.
You can reproduce this problem with the test code from here:
Comment out the 'workaround' on that line. Then run the code.
You get this error:
Starting...
Using PASSWORD token for auth
Exception in thread "main" java.lang.NullPointerException
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.lambda$toApplicationManifest$10(ApplicationManifestUtils.java:230)
at java.util.Optional.ifPresent(Optional.java:159)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.as(ApplicationManifestUtils.java:103)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.asString(ApplicationManifestUtils.java:156)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.toApplicationManifest(ApplicationManifestUtils.java:230)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.lambda$null$7(ApplicationManifestUtils.java:186)
at java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:891)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.lambda$doRead$8(ApplicationManifestUtils.java:182)
at java.util.Optional.ifPresent(Optional.java:159)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.doRead(ApplicationManifestUtils.java:181)
at org.cloudfoundry.operations.applications.ApplicationManifestUtils.read(ApplicationManifestUtils.java:70)
at com.github.kdvolder.cfv2sample.CFV2SampleMain.pushAnApp(CFV2SampleMain.java:88)
at com.github.kdvolder.cfv2sample.CFV2SampleMain.main(CFV2SampleMain.java:78)