Validate pointer before access the member.
Validate pointer before access the member.

When Git repository at network locations, sometimes git_iterator_for_tree
fails at iterator__update_ignore_case so it goes to git_iterator_free.
Null pointer will crash the process if not check.

Signed-off-by: Colin Xu <0f9700d38502a5bc304aee5e9fcaccd684f96120@gmail.com>

stewid/libgit2,Corillian/libgit2,joshtriplett/libgit2,leoyanggit/libgit2,leoyanggit/libgit2,joshtriplett/libgit2,Corillian/libgit2,leoyanggit/libgit2,joshtriplett/libgit2,jeffhostetler/public_libgit2,Corillian/libgit2,joshtriplett/libgit2,stewid/libgit2,stewid/libgit2,jeffhostetler/public_libgit2,joshtriplett/libgit2,leoyanggit/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,leoyanggit/libgit2,jeffhostetler/public_libgit2,Corillian/libgit2,jeffhostetler/public_libgit2,stewid/libgit2,stewid/libgit2,saurabhsuniljain/libgit2,saurabhsuniljain/libgit2,saurabhsuniljain/libgit2,Corillian/libgit2,stewid/libgit2,Corillian/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,joshtriplett/libgit2,saurabhsuniljain/libgit2,leoyanggit/libgit2