Handle NULL ptr expection.