Line 371 expect both to be well formed, I would recommend inserting a line
if (!on || !target) { return undefined; }
which would act as a safe-keeper.
I am using https://github.com/dbmdz/mirador-textoverlay and this seems to be provoked by a bad line in my ALTO (I suppose ?), but it still feel like some safety here would avoid a complete throw.
https://github.com/IIIF-Commons/manifesto/blob/72046aa7a901c0bfabe51c73598405ff76b73623/src/Canvas.ts#L370-L373
Line 371 expect both to be well formed, I would recommend inserting a line
which would act as a safe-keeper.
I am using https://github.com/dbmdz/mirador-textoverlay and this seems to be provoked by a bad line in my ALTO (I suppose ?), but it still feel like some safety here would avoid a complete throw.