Add exception FreehandNullSegmentError and handle it gracefully.