Skip to content

Commit 97bafc4

Browse files
committed
Revert to use null check so secondary method can be attempted
Thanks to @chrootchad
1 parent 36d6a63 commit 97bafc4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Attachment.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,7 @@ public function save(string $path): false|int
8181
*/
8282
public function extension(): ?string
8383
{
84-
if (! $this->filename) {
85-
return null;
86-
}
87-
88-
if ($ext = pathinfo($this->filename, PATHINFO_EXTENSION)) {
84+
if ($ext = pathinfo($this->filename ?? '', PATHINFO_EXTENSION)) {
8985
return $ext;
9086
}
9187

0 commit comments

Comments
 (0)