When using the Page Viewer with ALTO-XML, I got a NullPointerException when a Shape-element containing a Polygon was located directly below a ComposedBlock-element (which in turn was directly below PrintSpace). In that particular case, currentRegion does not seem to be set at the time the Polygon element is handled. Checking for currentRegion != null seems to fix that problem.
When using the Page Viewer with ALTO-XML, I got a NullPointerException when a Shape-element containing a Polygon was located directly below a ComposedBlock-element (which in turn was directly below PrintSpace). In that particular case, currentRegion does not seem to be set at the time the Polygon element is handled. Checking for currentRegion != null seems to fix that problem.