Exception when changing extension password

Trying to change a password on one of my exentions and getting the following error:

"Whoops \ Exception \ ErrorException (E_WARNING)

in_array() expects parameter 2 to be array, string given"

Other exentions change without error.

Trace:

  1. Whoops\Exception\ErrorException
    /­var/­www/­html/­admin/­modules/­endpointman/­includes/­functions.inc1320
  2. Whoops\Run handleError
    <#unknown>0
  3. in_array
    /­var/­www/­html/­admin/­modules/­endpointman/­includes/­functions.inc1320
  4. endpointmanager write_configs
    /­var/­www/­html/­admin/­modules/­endpointman/­includes/­functions.inc1625
  5. endpointmanager prepare_configs
    /­var/­www/­html/­admin/­modules/­endpointman/­functions.inc.php149
  6. endpointman_configpageinit
    /­var/­www/­html/­admin/­libraries/­BMO/­GuiHooks.class.php267
  7. FreePBX\GuiHooks doConfigPageInits
    /­var/­www/­html/­admin/­config.php354

Code:
foreach ($returned_data as $file => $data) {
if (((file_exists($write_path . $file)) AND (is_writable($write_path . $file)) AND (!in_array($file, $provisioner_lib->protected_files))) OR (!file_exists($write_path . $file))) {
//Move old file to backup
if (!$this->global_cfg[‘backup_check’]) {