From 534a9fb8c1e8ee6c40be90cb43c89bafb2cfbb24 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 20 Jan 2012 22:27:43 +0200 Subject: [PATCH] Allow creator function to return null to indicate failure --- source/collection.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } }; -- 2.45.2