Move processing of data into 'if chunk !== null'

This was causing tailwrap failures when the -f options wasn't used