Cannot create a page when email includes both an image in the body and an attachment

Description

Log record:
biz.artemissoftware.confluence.sendemailtopage.SendEMailToPageJob.fireEMailCheck(SendEMailToPageJob.java:353) [http-nio-8090-exec-5] ERROR java.lang.NullPointerException

Freshdesk Tickets

None

Create a Support Ticket

Activity

Show:
Ture Hoefner
July 21, 2020, 4:04 PM

I am using this bug to fix the NullPointerException for emails that use a non-existent space. I am not able to reproduce any NullPointerException with adding attachments.

Ture Hoefner
July 16, 2020, 8:15 PM
Edited

I can't break it. An email with an image in the body and also an attachment works fine for me.

One thing I did notice, though, was an NPE for sending an email using a space key for a space that does not exist on the server:

[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at biz.artemissoftware.confluence.sendemailtopage.actions.AddPageAction.execute(AddPageAction.java:63)
[INFO] [talledLocalContainer] at biz.artemissoftware.confluence.sendemailtopage.EmailEntity.executeActionQueue(EmailEntity.java:66)
[INFO] [talledLocalContainer] at biz.artemissoftware.confluence.sendemailtopage.SendEMailToPageJob.fireEMailCheck(SendEMailToPageJob.java:293)
[INFO] [talledLocalContainer] at biz.artemissoftware.confluence.sendemailtopage.SendEMailToPageJob$1.doInTransaction(SendEMailToPageJob.java:148)
[INFO] [talledLocalContainer] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21)
[INFO] [talledLocalContainer] at com.atlassian.sal.spring.component.SpringHostContextAccessor$1.doInTransaction(SpringHostContextAccessor.java:71)
[INFO] [talledLocalContainer] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)

I specified the space key with a command tag like: <M2P:space=BT>

steps to reproduce:

  • compose an email w/ any title, the title will be used as the name of a page to create

  • in the body of the (HTML) email insert an image

  • attach some file to the email. I used a *.docx file from a customer

  • send the email to the account configured for M2P

  • in the M2P admin tool click "Check Email Now"

  • see an NPE in the server log (or console in dev).

From AddPageAction#execute:

Fixed

Assignee

Ture Hoefner

Reporter

Vlad PolonTech