check null for FlattenPath, firstPoint