File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,16 @@ public function isStorageAvailable(): bool {
140
140
*/
141
141
public function hasAttachment (AttachmentInterface $ attachment ): bool {
142
142
$ fileName = $ this ->getAttachmentFileName ($ attachment );
143
- return file_exists ("{$ this ->absolutePath }/ $ fileName " );
143
+ return file_exists ("{$ this ->absolutePath }/ { $ fileName} " );
144
144
}
145
145
146
146
/**
147
147
* @param AttachmentInterface $attachment
148
148
*/
149
149
public function removeAttachment (AttachmentInterface $ attachment ): void {
150
- if ($ this ->hasAttachment ($ attachment )) {
151
- unlink ($ this ->getAttachmentFileName ($ attachment ));
150
+ $ fileName = $ this ->getAttachmentFileName ($ attachment );
151
+ if ($ fileName !== null && $ this ->hasAttachment ($ attachment )) {
152
+ unlink ("{$ this ->absolutePath }/ {$ fileName }" );
152
153
}
153
154
}
154
155
You can’t perform that action at this time.
0 commit comments