File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -664,8 +664,8 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
664
664
/**
665
665
* Loads attachment items from scope
666
666
*/
667
- protected _attachmentsFromScope ( scope : Scope | undefined ) : AttachmentItem [ ] | undefined {
668
- return scope ?. getAttachments ( ) ?. map ( a => createAttachmentEnvelopeItem ( a ) ) ;
667
+ protected _attachmentsFromScope ( scope : Scope | undefined ) : AttachmentItem [ ] {
668
+ return scope ?. getAttachments ( ) ?. map ( a => createAttachmentEnvelopeItem ( a ) ) || [ ] ;
669
669
}
670
670
671
671
/**
Original file line number Diff line number Diff line change @@ -155,17 +155,19 @@ export class NodeClient extends BaseClient<NodeClientOptions> {
155
155
/**
156
156
* @inheritDoc
157
157
*/
158
- protected _attachmentsFromScope ( scope : Scope | undefined ) : AttachmentItem [ ] | undefined {
159
- return scope ?. getAttachments ( ) ?. map ( attachment => {
160
- let [ pathOrData , options ] = attachment ;
161
-
162
- if ( typeof pathOrData === 'string' && existsSync ( pathOrData ) ) {
163
- options = options || { } ;
164
- options . filename = basename ( pathOrData ) ;
165
- pathOrData = readFileSync ( pathOrData ) ;
166
- }
158
+ protected _attachmentsFromScope ( scope : Scope | undefined ) : AttachmentItem [ ] {
159
+ return (
160
+ scope ?. getAttachments ( ) ?. map ( attachment => {
161
+ let [ pathOrData , options ] = attachment ;
162
+
163
+ if ( typeof pathOrData === 'string' && existsSync ( pathOrData ) ) {
164
+ options = options || { } ;
165
+ options . filename = basename ( pathOrData ) ;
166
+ pathOrData = readFileSync ( pathOrData ) ;
167
+ }
167
168
168
- return createAttachmentEnvelopeItem ( [ pathOrData , options ] ) ;
169
- } ) ;
169
+ return createAttachmentEnvelopeItem ( [ pathOrData , options ] ) ;
170
+ } ) || [ ]
171
+ ) ;
170
172
}
171
173
}
You can’t perform that action at this time.
0 commit comments