diff --git a/SniperKernel/src/Sniper.cc b/SniperKernel/src/Sniper.cc index 8257b92..aa1c437 100644 --- a/SniperKernel/src/Sniper.cc +++ b/SniperKernel/src/Sniper.cc @@ -41,10 +41,18 @@ namespace Sniper DLElement *Sniper::create(const std::string &json_str) { - auto json = SniperJSON::loads(json_str); + DLElement *pobj = nullptr; - DLElement *pobj = DLEFactory::instance().create(json["identifier"].get()); - pobj->eval(json); + auto json = SniperJSON::loads(json_str); + if (json.isMap()) + { + pobj = DLEFactory::instance().create(json["identifier"].get()); + pobj->eval(json); + } + else + { + pobj = DLEFactory::instance().create(json_str); + } return pobj; }