Skip to content

Commit

Permalink
BAP-11039: Integrity constraint violation during IMAP synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
mccar committed Jul 12, 2016
1 parent 9543310 commit ec62d3f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,10 @@ protected function removeImapEmailReference(ImapEmail $imapEmail)

$emailUser = $imapEmail->getEmail()->getEmailUserByFolder($imapEmail->getImapFolder()->getFolder());
if ($emailUser != null) {
$imapEmail->getEmail()->getEmailUsers()->removeElement($emailUser);
$emailUser->removeFolder($imapEmail->getImapFolder()->getFolder());
if (!$emailUser->getFolders()->count()) {
$imapEmail->getEmail()->getEmailUsers()->removeElement($emailUser);
}
}
$this->em->remove($imapEmail);
}
Expand Down

0 comments on commit ec62d3f

Please sign in to comment.