Temporary fix to NPE caused by null shape. References #2525