alpheios-project / arethusa

Arethusa: Annotation Environment
http://sosol.perseids.org/tools/arethusa
MIT License
34 stars 26 forks source link

Display tree if comments not configured #827

Closed zfletch closed 3 years ago

zfletch commented 3 years ago

If the comments plugin is not configured in the global config, but the treebank XML has a config type that requires comments (e.g. config="pedalion"), then the tree fails to display with the error:

Error: can't access property "getData", w is undefined

This PR fixes the error by wrapping the w.getData() call with if (w) { ... } so that the tree is still displayed.

zfletch commented 3 years ago

Adding a comment is a good idea and I've updated the PR.

I don't think the comment plugin will still work if there is no retriever. The particular issue I'm trying to solve is being able to display a tree with config="pedalion" in the Treebank Template without Arethusa crashing and displaying a blank canvas.