Fix an unhandled exception when response is not set