Skip to content

Commit

Permalink
Missing variable check added to prevent error while parsing an address
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Oct 15, 2020
1 parent 8354f23 commit 4995a3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
## [UNRELEASED]
### Fixed
- Prevent text bodies from being fetched as attachment #27
- Missing variable check added to prevent exception while parsing an address [webklex/laravel-imap #356](https://github.com/Webklex/laravel-imap/issues/356)

### Added
- NaN

### Affected Classes
- [Message::class](src/Message.php)
- [Header::class](src/Header.php)

### Breaking changes
- Text bodies might no longer get fetched as attachment
Expand Down
4 changes: 4 additions & 0 deletions src/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ private function extractAddresses($header) {
private function parseAddresses($list) {
$addresses = [];

if (is_array($list) === false) {
return $addresses;
}

foreach ($list as $item) {
$address = (object) $item;

Expand Down

0 comments on commit 4995a3e

Please sign in to comment.