Fix index out of range bug in ConnectionDB.
Replace NULL with nullptr.