Catching a possible nullpointer exception.