Skip to content

Commit 7f3370d

Browse files
committed
fixup! examples/annotations: update functionality of channelName and namespace
1 parent 8f71d14 commit 7f3370d

File tree

1 file changed

+4
-2
lines changed
  • examples/pub-sub-message-annotations/javascript/src/components

1 file changed

+4
-2
lines changed

examples/pub-sub-message-annotations/javascript/src/components/summary.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,17 @@ export function updateAnnotationSummary(message: MessageSummary) {
242242
}
243243

244244
sectionsContainer.innerHTML = '';
245-
const hasAnnotations = annotationTypes.some((type) => message.annotations.summary && message.annotations.summary[`${annotationNamespace}:${type.key}`]);
245+
const hasAnnotations = annotationTypes.some(
246+
(type) => message.annotations?.summary && message.annotations?.summary[`${annotationNamespace}:${type.key}`],
247+
);
246248

247249
if (!hasAnnotations) {
248250
sectionsContainer.appendChild(createEmptyAnnotationSummaryContentElement());
249251
return;
250252
}
251253

252254
for (const { key } of annotationTypes) {
253-
const entry = message.annotations.summary[`${annotationNamespace}:${key}`];
255+
const entry = message.annotations?.summary[`${annotationNamespace}:${key}`];
254256
if (!entry) {
255257
continue;
256258
}

0 commit comments

Comments
 (0)