fix crash caused by empty packets and add more checks
add parenthses
Merge pull request #153 from licaiguo/fix-empty-packets

fix crash caused by empty packets and add more checks -- review request #44