Restructure use of doall to avoid NPE during harvesting