Skip to content

Commit

Permalink
Protect against NRE.
Browse files Browse the repository at this point in the history
This would mean the delivery status msg is most likely broken,
but we don't want an fatal exception thrown becuase of it.
  • Loading branch information
mrubinsk committed Jun 28, 2020
1 parent 06ed3b9 commit b43ad83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Mime/Viewer/Status.php
Expand Up @@ -88,6 +88,11 @@ protected function _renderInfo()
$action = null;
$part2 = $this->getConfigParam('imp_contents')->getMIMEPart($part2_id);

// This would be a broken msg, but don't cause an exception because of it
if (is_null($part2)) {
return array();
}

foreach (explode("\n", $part2->getContents()) as $line) {
if (stristr($line, 'Action:') !== false) {
$action = strtolower(trim(substr($line, strpos($line, ':') + 1)));
Expand Down

0 comments on commit b43ad83

Please sign in to comment.