fixed warn and replace NULL with nullptr.