Avoid crashing when receiving invalid HTTP protocol data