From 6c8408954ac8e1da1973e68589594d6b36b30bc4 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 4 Dec 2020 10:33:18 +1300 Subject: [PATCH] [REF] use early return for errors rather than confusing assignment This just makes the code slightly clearer. The next if can go, but needs to wait on another PR to be merged to avoid conflict --- CRM/Contact/Import/Parser/Contact.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index dc3441baaa..0057621513 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -1680,8 +1680,9 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { if ((is_null($error)) && (civicrm_error(_civicrm_api3_deprecated_validate_formatted_contact($formatted)))) { $error = _civicrm_api3_deprecated_validate_formatted_contact($formatted); } - - $newContact = $error; + if (!is_null($error)) { + return $error; + } if (is_null($error)) { if ($contactId) { -- 2.25.1