ALF-11625: Exception occurs on server startup relating to FeedNotifier

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32492 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-12-02 19:02:50 +00:00
parent bae80cd121
commit b2b10ac521

View File

@@ -316,8 +316,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
@Override
public Void execute() throws Throwable
{
// Only try and send the email if the actioned upon node reference still exists
if (nodeService.exists(actionedUponNodeRef) == true)
if (validNodeRefIfPresent(actionedUponNodeRef))
{
prepareAndSendEmail(ruleAction, actionedUponNodeRef);
}
@@ -329,13 +328,30 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
}
else
{
if (nodeService.exists(actionedUponNodeRef) == true)
if (validNodeRefIfPresent(actionedUponNodeRef))
{
prepareAndSendEmail(ruleAction, actionedUponNodeRef);
}
}
}
private boolean validNodeRefIfPresent(NodeRef actionedUponNodeRef)
{
if (actionedUponNodeRef == null)
{
// We must expect that null might be passed in (ALF-11625)
// since the mail action might not relate to a specific nodeRef.
return true;
}
else
{
// Only try and send the email if the actioned upon node reference still exists
// (i.e. if one has been specified it must be valid)
return nodeService.exists(actionedUponNodeRef);
}
}
private boolean sendAfterCommit(Action action)
{
Boolean sendAfterCommit = (Boolean) action.getParameterValue(PARAM_SEND_AFTER_COMMIT);