Details
-
Bug
-
Resolution: Timed out
-
Low
-
None
-
5.0.5
-
Linux, Plugin SDK 3.9.2
-
5
-
Severity 3 - Minor
-
-
Description
The message creating API is not clear, but that is exacerbated significantly by a poorly caught NPE.
If you call AttachmentManager.createAttachment(...) (and I suspect the same for the method on MessageHandlerContext.createAttachment(...) ) with a MutableIssue which has not yet been created, MutableIssue.getKey() is called and null is returned, but this value is not checked before being passed to the constructor of File(String, String). This throws an NPE and causes the misleading (and incorrect) error message:
com.atlassian.jira.web.util.AttachmentException: Exception trying to establish attachment directory. Check that the application server and JIRA have permissions to write to it: java.lang.NullPointerException
I am not sure if this should be a feature request or a bug, but due to the erroneous nature of the message and the poorly handled NPE I'd err on the side of bug (but very minor one).
For details, see JSP-127687