Skip to content

Commit

Permalink
Check centroid before using
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Feb 3, 2025
1 parent dc3fd18 commit 04d8720
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,14 @@ dwvjq.gui.DrawList = function (app) {
var simpleDetails = [];
for (var i = 0; i < annotations.length; ++i) {
var annotation = annotations[i];
var centroid = annotation.getCentroid();
var posStr;
if (typeof centroid !== 'undefined') {
posStr = pointToString(centroid);
}
var simpleDetail = {
id: annotation.id,
position: pointToString(annotation.getCentroid()),
position: posStr,
type: capitalizeFirstLetter(annotation.getFactory().getName()),
color: annotation.colour,
description: annotation.textExpr
Expand Down

0 comments on commit 04d8720

Please sign in to comment.