]> git.tdb.fi Git - libs/datafile.git/commitdiff
Allow creator function to return null to indicate failure
authorMikko Rasa <tdb@tdb.fi>
Fri, 20 Jan 2012 20:27:43 +0000 (22:27 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 20 Jan 2012 20:27:43 +0000 (22:27 +0200)
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);
        }
 };