Skip to content

Commit

Permalink
Merge pull request #65 from TheDMSGroup/ENG-278
Browse files Browse the repository at this point in the history
Prevent exception when no fields are provided via Source API.
  • Loading branch information
heathdutton authored May 8, 2018
2 parents 7cad061 + 44069c0 commit 7610515
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Model/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,12 @@ private function createContact()
// Must have at least ONE valid contact field (some are to be ignored since we provide them or they are core).
$ignore = ['ip', 'attribution', 'attribution_date', 'utm_source'];
if (!count(array_diff_key($this->fieldsProvided, array_flip($ignore)))) {
return null;
throw new ContactSourceException(
'There were no fields provided. A contact could not be created.',
Codes::HTTP_BAD_REQUEST,
null,
Stat::TYPE_INVALID
);
}

// Dynamically generate the field map and import.
Expand Down

0 comments on commit 7610515

Please sign in to comment.