Add a unit test for handling a null exception