[MGNLMAIL-3] MgnlMailFactory fails with NPE when failing to initialise renderer Created: 26/Nov/12 Updated: 27/Nov/12 Resolved: 26/Nov/12 |
|
| Status: | Closed |
| Project: | Magnolia Mail Module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Roman Kovařík | Assignee: | Roman Kovařík |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Description |
if(renderers.containsKey(template.getType().toLowerCase())){
String rendererClass = renderers.get(template.getType().toLowerCase());
mail = Classes.quietNewInstance(rendererClass, template);
}
else {
mail = new SimpleEmail(template);
}
quietNewInstance() will return null in case of failure to instantiate renderer. This leads to NPE later down in the code when attempting to set properties on mail. I believe that failure to create renderer should not be swallowed but propagated up to calling code. |
| Comments |
| Comment by Roman Kovařík [ 26/Nov/12 ] |