[GEOT-4586] Null attribute value causes NPE in SumVisitor

A fix for GEOT-4586.
As the fix creates new file, my company had signed the corporate contributor license agreement, and it was sent to the OSGeo.