Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.1.4
-
None
-
Unknown
-
N/A
-
N/A
-
Description
If using a mail template from a different wiki, the current wiki's mail class will be resolved when fetching the XWiki.Mail object from the template document.
This fails to find the object and a NPE is thrown:
java.lang.NullPointerException: null at org.xwiki.mail.internal.factory.template.DefaultMailTemplateManager.getMailObjectsCount(DefaultMailTemplateManager.java:154) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at org.xwiki.mail.internal.factory.template.DefaultMailTemplateManager.getObjectMailNumber(DefaultMailTemplateManager.java:126) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at org.xwiki.mail.internal.factory.template.DefaultMailTemplateManager.evaluate(DefaultMailTemplateManager.java:93) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at org.xwiki.mail.internal.factory.template.AbstractTemplateMimeMessageFactory.createMessage(AbstractTemplateMimeMessageFactory.java:96) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at org.xwiki.mail.internal.factory.template.AbstractTemplateMimeMessageFactory.createMessage(AbstractTemplateMimeMessageFactory.java:47) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at org.xwiki.watchlist.internal.notification.WatchListEventMimeMessageIterator.next(WatchListEventMimeMessageIterator.java:141) ~[xwiki-platform-watchlist-api-7.2-SNAPSHOT.jar:na] at org.xwiki.watchlist.internal.notification.WatchListEventMimeMessageIterator.next(WatchListEventMimeMessageIterator.java:52) ~[xwiki-platform-watchlist-api-7.2-SNAPSHOT.jar:na] at org.apache.commons.collections4.iterators.IteratorIterable$1.next(IteratorIterable.java:77) ~[commons-collections4-4.0.jar:4.0] at org.xwiki.mail.internal.thread.PrepareMailRunnable.prepareMail(PrepareMailRunnable.java:118) [xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at org.xwiki.mail.internal.thread.PrepareMailRunnable.run(PrepareMailRunnable.java:74) [xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]