Don't try to receive bytes from BlueTooth until you have successfully tested the number of bytes available for reception and tested that the number of bytes available > 0.