When adding a createOrComment mail handler with no params you get a NPE when the handler tries to handle the mail

XMLWordPrintable

    • 3.07

      When configuring a CreateOrCommentHandler, or any handler for that matter, you will get an NPE if you don't specify any parameters at all. It looks like this:

      java.lang.NullPointerException
      	at com.atlassian.jira.service.util.handler.AbstractMessageHandler.init(AbstractMessageHandler.java:100)
      	at com.atlassian.jira.service.util.handler.CreateIssueHandler.init(CreateIssueHandler.java:60)
      	at com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:114)
      	at com.atlassian.jira.service.services.mail.MailFetcherService.run(MailFetcherService.java:190)
      	at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:67)
      	at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
      	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
      

      This is because in AbstractMessageHandlingService line 42, the params map does not get set on the handler if there is no param. We should instead at least init the params to an empty map. We should probably alert the user on the input screen that they need some parameters.

              Assignee:
              TimP
              Reporter:
              Dylan Etkin [Atlassian]
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: