diff --git a/app/Thread.php b/app/Thread.php index ae475d224..96a0327de 100644 --- a/app/Thread.php +++ b/app/Thread.php @@ -1458,7 +1458,10 @@ public function getHeader($header_name) public function getFromHeader() { - preg_match("#From:\s*.*[^\s]*\s*<\s*(.*[^\s])\s*>\s*\n#", $this->headers, $m); + if (empty($this->headers)) { + return ''; + } + preg_match("#From:\s*.*[^\s]*\s*<\s*(.*[^\s])\s*>\s*\n#", $this->headers ?? '', $m); return $m[1] ?? ''; }