-
Bug
-
Resolution: Fixed
-
Neutral
-
4.5.4
-
None
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.
Also code above should be able to handle situation when template type is not specified at all (And choose SimpleMail like in case of unrecognized renderer.
Acceptance criteria
- is cloned by
-
MGNLMAIL-3 MgnlMailFactory fails with NPE when failing to initialise renderer
- Closed