]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/collection.h
Allow creator function to return null to indicate failure
[libs/datafile.git] / source / collection.h
index 021b714a934e05dbb190dd4b2b473f1607b160e6..91f8f070cefbfabe0e0f5a878743fd9eb4e38f00 100644 (file)
@@ -341,7 +341,8 @@ public:
                if(!creat)
                        throw std::runtime_error("no creator");
                T *obj = creat->create(coll, name);
-               store->store(coll, name, obj);
+               if(obj)
+                       store->store(coll, name, obj);
        }
 };