Fixed bug for nullptr.