Fix NPE when copying error message data to the response