StringIndexOutOfBoundsException at trigger


I am getting the following error when a document is published to a Serial processing trigger.

Exception:com.wm.lang.flow.FlowException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 while executing trigger. Rejecting Document for TriggerStore:trigger name

I have checked the service (using save and restore pipeline services) that is invoked by the trigger and everything seems to work properly. Please help.