Update Object.cpp

Fixed unchecked pointer dereference