Skip to content

Commit

Permalink
Fixed #148 properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Croker committed Jun 18, 2020
1 parent 8879228 commit 1ad56b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/PendingContactsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ public function verifyPendingContact(string $pid)
{
$pendingContact = $this->getPendingContactByPid($pid);

if ($pendingContact === null) {
return null;
}

// Get contact if it exists
$contact = Campaign::$plugin->contacts->getContactByEmail($pendingContact->email);

Expand All @@ -116,7 +120,7 @@ public function verifyPendingContact(string $pid)

// If no contact found or trashed contact could not be restored
if ($contact === null || !Craft::$app->getElements()->restoreElement($contact)) {
return null;
$contact = new ContactElement();
}
}

Expand Down

0 comments on commit 1ad56b6

Please sign in to comment.