diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp index 2cf27b2130d..7ff88d47e23 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp @@ -475,8 +475,14 @@ bool Base::parseField( const std::string& attribute, const std::string& value) } else { - BaseData* parentData = dataVec[d]->getParent(); - msg_info() << "Link from parent Data " << value << " (" << parentData->getValueTypeInfo()->name() << ") to Data " << attribute << "(" << dataVec[d]->getValueTypeInfo()->name() << ") OK"; + if (BaseData* parentData = dataVec[d]->getParent()) + { + msg_info() << "Link from parent Data " + << value << " (" << parentData->getValueTypeInfo()->name() << ") " + << "to Data " + << attribute << " (" << dataVec[d]->getValueTypeInfo()->name() << ") " + << "OK"; + } } /* children Data cannot be modified changing the parent Data value */ dataVec[d]->setReadOnly(true);