File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
examples/pub-sub-message-annotations/javascript/src/components Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -242,15 +242,17 @@ export function updateAnnotationSummary(message: MessageSummary) {
242
242
}
243
243
244
244
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
+ ) ;
246
248
247
249
if ( ! hasAnnotations ) {
248
250
sectionsContainer . appendChild ( createEmptyAnnotationSummaryContentElement ( ) ) ;
249
251
return ;
250
252
}
251
253
252
254
for ( const { key } of annotationTypes ) {
253
- const entry = message . annotations . summary [ `${ annotationNamespace } :${ key } ` ] ;
255
+ const entry = message . annotations ? .summary [ `${ annotationNamespace } :${ key } ` ] ;
254
256
if ( ! entry ) {
255
257
continue ;
256
258
}
You can’t perform that action at this time.
0 commit comments