Skip to content

Commit 36d6a63

Browse files
authored
Merge pull request #133 from chrootchad/bug-132
Fix: issue 132 - pathinfo(): Passing null to parameter #1 () of type …
2 parents 2a9638f + 2eca248 commit 36d6a63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Attachment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public function save(string $path): false|int
8181
*/
8282
public function extension(): ?string
8383
{
84+
if (! $this->filename) {
85+
return null;
86+
}
87+
8488
if ($ext = pathinfo($this->filename, PATHINFO_EXTENSION)) {
8589
return $ext;
8690
}

0 commit comments

Comments
 (0)