Salome HOME
Make list not initialized if it is empty: on sketch add and then remove element sketc...
[modules/shaper.git] / src / Model / Model_AttributeRefList.cpp
index 13233fb9c4e0128becbf03d324014051ceb4539e..b1fcda04632516822a6a4ae3c9abdbd4d95320dd 100644 (file)
@@ -54,6 +54,14 @@ int Model_AttributeRefList::size() const
   return myRef->Extent();
 }
 
+bool Model_AttributeRefList::isInitialized()
+{
+  if (size() == 0) { // empty list is not initialized list: sketch will be not valid after add/undo
+    return false;
+  }
+  return ModelAPI_AttributeRefList::isInitialized();
+}
+
 list<ObjectPtr> Model_AttributeRefList::list()
 {
   std::list<ObjectPtr> aResult;