diff --git a/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationTooltip2.tsx b/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationTooltip2.tsx
index c8c3deec319..641f0044a43 100644
--- a/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationTooltip2.tsx
+++ b/public/app/plugins/panel/timeseries/plugins/annotations2/AnnotationTooltip2.tsx
@@ -32,7 +32,7 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, onEdit }: Prop
});
let time = timeFormatter(annoVals.time[annoIdx]);
- let text = annoVals.text[annoIdx];
+ let text = annoVals.text?.[annoIdx] ?? '';
if (annoVals.isRegion?.[annoIdx]) {
time += ' - ' + timeFormatter(annoVals.timeEnd[annoIdx]);
@@ -56,7 +56,7 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, onEdit }: Prop
// alertText = alertDef.getAlertAnnotationInfo(annotation); // @TODO ??
} else if (annoVals.title?.[annoIdx]) {
- text = annoVals.title[annoIdx] + '
' + (typeof text === 'string' ? text : '');
+ text = annoVals.title[annoIdx] + text ? `
${text}` : '';
}
return (