Skip to content

Commit

Permalink
Update packages/builders/src/messages/embed/UnsafeEmbed.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Almeida <almeidx@pm.me>
  • Loading branch information
suneettipirneni and almeidx committed Feb 7, 2022
1 parent 5e097a7 commit 891e99b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/builders/src/messages/embed/UnsafeEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export class UnsafeEmbed {
* @param fields The replacing field objects
*/
public spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {
this.data.fields?.splice(index, deleteCount, ...UnsafeEmbed.normalizeFields(...fields));
this.data.fields ??= [];
this.data.fields.splice(index, deleteCount, ...UnsafeEmbed.normalizeFields(...fields));
return this;
}

Expand Down

0 comments on commit 891e99b

Please sign in to comment.