Skip to content

Commit 8ab921d

Browse files
committed
Mail: getHeader now returns NULL when header not available
1 parent 7a88095 commit 8ab921d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

MailLibrary/Mail.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ public function getHeaders()
124124
public function getHeader($name)
125125
{
126126
$this->headers !== NULL || $this->initializeHeaders();
127-
return $this->headers[$this->formatHeaderName($name)];
127+
$index = $this->formatHeaderName($name);
128+
if(isset($this->headers[$index])) {
129+
return $this->headers[$index];
130+
} else {
131+
return NULL;
132+
}
128133
}
129134

130135
/**

0 commit comments

Comments
 (0)