Skip to content

Commit

Permalink
Changing expression check to option chain
Browse files Browse the repository at this point in the history
  • Loading branch information
syedzubeen authored Oct 3, 2023
1 parent dd13344 commit f6199e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/src/helpers/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ export class MessageHelpers {
}

const headers = msg.headers();
if (headers && headers.examples()) {
return headers.examples()?.map(example => ({ example }));
const examples = headers?.examples?.();
if (examples) {
return examples.map(example => ({ example }));
}

return;
Expand Down

0 comments on commit f6199e6

Please sign in to comment.