X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeReference.cpp;h=e164ffdb034dd7ea060ccdb51aeb1767c6233938;hb=81baa77e52cb1ade2bfbe5b21e893cc34b03c323;hp=0b2d2869a3ed7f120f5f1449c405a21d598d94d9;hpb=77d6e03555d0d46232e09ace4178f66f8c9b40ee;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeReference.cpp b/src/Model/Model_AttributeReference.cpp index 0b2d2869a..e164ffdb0 100644 --- a/src/Model/Model_AttributeReference.cpp +++ b/src/Model/Model_AttributeReference.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -82,11 +82,13 @@ ObjectPtr Model_AttributeReference::value() Handle(TDataStd_AsciiString) anEntry; if (myRef->Label().FindAttribute(TDataStd_AsciiString::GetID(), anEntry)) { std::shared_ptr aDR = std::dynamic_pointer_cast(aRefDoc); - TDF_Label aRefLab; - TDF_Tool::Label(aDR->objects()->featuresLabel().Data(), - anEntry->Get().ToCString(), aRefLab); - if (!aRefLab.IsNull()) { - return aDR->objects()->object(aRefLab); + if (aDR.get() && aDR->objects()) { + TDF_Label aRefLab; + TDF_Tool::Label(aDR->objects()->featuresLabel().Data(), + anEntry->Get().ToCString(), aRefLab); + if (!aRefLab.IsNull()) { + return aDR->objects()->object(aRefLab); + } } } }