diff --git a/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts b/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts index 75c1d5206..6f09aec92 100644 --- a/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts +++ b/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts @@ -31,7 +31,7 @@ export const operationMessagesUnambiguity = createRulesetFunction<{ channel?: {' const channelPointer = targetVal.channel?.$ref as string; // required targetVal.messages?.forEach((message, index) => { - if (!message.$ref.startsWith(`${channelPointer}/messages`)) { + if (message.$ref && !message.$ref.startsWith(`${channelPointer}/messages`)) { results.push({ message: 'Operation message does not belong to the specified channel.', path: [...ctx.path, 'messages', index],