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 case when template is not found #47

Open
tess1o opened this issue Jan 27, 2022 · 0 comments
Open

NullPointerException in case when template is not found #47

tess1o opened this issue Jan 27, 2022 · 0 comments

Comments

@tess1o
Copy link

tess1o commented Jan 27, 2022

In case when template is not found the library throws NPE. A better exception with valid message is expected.

2022-01-27 12:47:30 [https-jsse-nio-8433-exec-2] ERROR org.apache.juli.logging.DirectJDKLog.log 175 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: com.github.dgroup.velocity.template.TemplateException: com.github.dgroup.velocity.template.TemplateException: java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
	at java.io.Reader.<init>(Reader.java:78)
	at java.io.InputStreamReader.<init>(InputStreamReader.java:113)
	at org.cactoos.text.TextOf.<init>(TextOf.java:352)
	at com.github.dgroup.velocity.template.TemplateEnvelope.lambda$new$0(TemplateEnvelope.java:71)
	at com.github.dgroup.velocity.template.TemplateEnvelope.compose(TemplateEnvelope.java:122)
	at com.github.dgroup.velocity.template.TemplateEnvelope.compose(TemplateEnvelope.java:105)
	at com.github.dgroup.velocity.template.TemplateEnvelope.compose(TemplateEnvelope.java:99)
	at com.github.dgroup.velocity.template.TemplateEnvelope.compose(TemplateEnvelope.java:47)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant