Fix possible crash when 0 bytes received