Handle Nullpointer exceptions.