BUG: 3808: fix failing test - add some pointer checks

Fixes regression detected here:

http://slicer.cdash.org/testDetails.php?test=5704490&build=266935

From: Steve Pieper <pieper@bwh.harvard.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23656 3bd1e089-480b-0410-8dfb-8563597acbee