Add back functionality removed in r210497.

Instead of asserting, output a message stating that a null pointer was found.