add protection
Merge pull request #1626 from dongzha/testcrash1

add protection