https://issues.apache.org/jira/browse/AMQ-4991 - fix npe and reinstate test