Details
Description
This looks like the wrong function was being used to exit. The way it was written it would have caused a fatal error due to the missing required param, but probably no one noticed because it was a silent ajax call.
Here is a fix: https://github.com/civicrm/civicrm-core/pull/8815