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

NullPointerException in TemplateOperationsImpl if a parameter value is null #1165

Closed
gastaldi opened this issue Aug 1, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@gastaldi
Copy link
Contributor

gastaldi commented Aug 1, 2018

In TemplateOperationsImpl#processLocally. if the map contains a null parameter value a NPE is thrown.

2018-08-01 17:14:51 WARN  ResourceChecker:53 - Exception in checker task
java.lang.NullPointerException
	at java.lang.String.replace(String.java:2240)
	at io.fabric8.openshift.client.dsl.internal.TemplateOperationsImpl.processLocally(TemplateOperationsImpl.java:205)
	at io.fabric8.openshift.client.dsl.internal.TemplateOperationsImpl.processLocally(TemplateOperationsImpl.java:157)
	at io.fabric8.openshift.client.dsl.internal.TemplateOperationsImpl.processLocally(TemplateOperationsImpl.java:59)
	at io.enmasse.controller.common.KubernetesHelper.processTemplate(KubernetesHelper.java:123)
	at io.enmasse.controller.TemplateInfraResourceFactory.createResourceList(TemplateInfraResourceFactory.java:85)
	at io.enmasse.controller.CreateController.handle(CreateController.java:104)
	at io.enmasse.controller.ControllerChain.onUpdate(ControllerChain.java:120)
	at io.enmasse.k8s.api.ResourceChecker.doWork(ResourceChecker.java:48)
	at io.enmasse.k8s.api.ResourceChecker.run(ResourceChecker.java:40)
	at java.lang.Thread.run(Thread.java:748)

A solution would be to treat the parameter value as an empty string

@gastaldi gastaldi added the bug label Aug 1, 2018
@odra
Copy link

odra commented Aug 1, 2018

I think it could be a good idea to log the parameter name if its value is null as well.

@gastaldi gastaldi self-assigned this Aug 1, 2018
@gastaldi
Copy link
Contributor Author

gastaldi commented Aug 1, 2018

PR available in #1166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants