Closed marc-schaefers closed 2 years ago
@marc-schaefers - Thanks for the submission! Are you seeing this NPE in actual usage of the library? Do you have a stack trace you can share? Just looking for a little more context on this.
Also, you need to click through the links above and appease the EasyCLA bot before we can accept this PR.
Hi, i use the PushApplicationRequest to push a static build pack with the cloud foundry java libs. I want to push it on a customer cloud foundry environment, so i haven't configure it or anything.
On one app name i get a nullpointer exception:
ERROR 18.11.2021 09:22:23.296 (de.aboutcontent.cloudfoundry.deploy.DeployExecutable): error on push java.lang.NullPointerException at org.cloudfoundry.operations.applications.DefaultApplications.lambda$getApplicationId$67(DefaultApplications.java:793) Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Assembly trace from producer [reactor.core.publisher.MonoIgnoreElements] : reactor.core.publisher.Mono.checkpoint(Mono.java:1902) org.cloudfoundry.operations.applications.DefaultApplications.pushManifest(DefaultApplications.java:432) Error has been observed at the following site(s): |_ Mono.checkpoint ⇢ at org.cloudfoundry.operations.applications.DefaultApplications.pushManifest(DefaultApplications.java:432) |_ Mono.checkpoint ⇢ at org.cloudfoundry.operations.applications.DefaultApplications.push(DefaultApplications.java:404) Stack trace: at org.cloudfoundry.operations.applications.DefaultApplications.lambda$getApplicationId$67(DefaultApplications.java:793)ations.java:793)
So i have changed this line to insert an empty map, if the jsons env null and now it works like expected.
Thanks for the additional info. I think I can see how it might get into that case. I'm kind of surprised that the server is returning null and not an empty map, but we should handle it either way.
Two points of feedback on the PR:
Optional
instead of the ternary operation & != null
check? Not a major difference, but it matches the style of the rest of the code better.Thanks
Hi @dmikusa-pivotal , the source code is updated now and i added a new push test case.
Sorry for the delay, Log4j2 issues had us scrambling before the holidays. Thanks for the PR!
avoid NPE, if environmentJsons is null from application entity