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) {
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 }
You can’t perform that action at this time.
0 commit comments