Fix possible NullPointerException.