IIIF-Commons / manifesto

IIIF Presentation API client and server utility library.
MIT License
46 stars 31 forks source link

onFragment breaks is both `on` and `target` properties are null #121

Closed PonteIneptique closed 1 year ago

PonteIneptique commented 1 year ago

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

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.

PonteIneptique commented 1 year ago

@stephenwf Thanks for the quick merge. Is it possible to release this as a bugfix ? :)

stephenwf commented 1 year ago

Yes, should be in v4.2.17 shortly 👍