Fix NullPointerException when for example the details of the task are
null while sending the email