From: Mikko Rasa Date: Fri, 20 Jan 2012 20:27:43 +0000 (+0200) Subject: Allow creator function to return null to indicate failure X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=commitdiff_plain;h=534a9fb8c1e8ee6c40be90cb43c89bafb2cfbb24 Allow creator function to return null to indicate failure --- diff --git a/source/collection.h b/source/collection.h index 021b714..91f8f07 100644 --- a/source/collection.h +++ b/source/collection.h @@ -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); } };