avoid setgmentation fault when arrayType expr is null
add testcase for cast null to array
Merge pull request #835 from zhaihj/commit-branch

temporarily fix #366