While adding two event types to a listener I get error "String index out of range: -1"

When I add Issue Updated and IssueLinkCreated events to a listener I see following error below and in the log file:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1967)

Listener still works, but error doesn’t look nice

Sounds like a scriptrunner bug. Report to them? https://productsupport.adaptavist.com/servicedesk/customer/portal/2