Skip to content

Commit

Permalink
Message-IDs might be missing, so need to catch/ignore that issue
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Sep 1, 2014
1 parent 448ad5a commit 85eda5c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions imp/lib/Maillog/Storage/History.php
Expand Up @@ -146,10 +146,16 @@ public function getLog(IMP_Maillog_Message $msg, array $filter = array())
*/
public function deleteLogs(array $msgs)
{
$this->_history->removeByNames(array_map(
array($this, '_getUniqueHistoryId'),
$msgs
));
$ids = array();
foreach ($msgs as $val) {
try {
$ids[] = $this->_getUniqueHistoryId($val);
} catch (RuntimeException $e) {
/* This is an invalid/missing Message-ID. Ignore. */
}
}

$this->_history->removeByNames($ids);
}

/**
Expand Down

0 comments on commit 85eda5c

Please sign in to comment.