From a0fc9677d4f875ef7bbf6dfcea175f123c6a29e2 Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Fri, 30 Aug 2002 22:12:13 +0000 Subject: cleaning up empty identity handling --- cpp/src/Ice/ReferenceFactory.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cpp/src/Ice/ReferenceFactory.cpp') diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index 1e7204ca004..a1f85c6c38f 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -45,6 +45,11 @@ IceInternal::ReferenceFactory::create(const Identity& ident, throw CommunicatorDestroyedException(__FILE__, __LINE__); } + if(ident.name.empty() && ident.category.empty()) + { + return 0; + } + // // Create new reference // @@ -108,6 +113,11 @@ IceInternal::ReferenceFactory::create(const Identity& ident, ReferencePtr IceInternal::ReferenceFactory::create(const string& str) { + if(str.empty()) + { + return 0; + } + const string delim = " \t\n\r"; string s(str); @@ -152,6 +162,11 @@ IceInternal::ReferenceFactory::create(const string& str) } Identity ident = stringToIdentity(idstr); + if(ident.name.empty() && ident.category.empty()) + { + return 0; + } + vector facet; Reference::Mode mode = Reference::ModeTwoway; bool secure = false; @@ -430,6 +445,11 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s) // constructor read the identity, and pass it as a parameter. // + if(ident.name.empty() && ident.category.empty()) + { + return 0; + } + vector facet; s->read(facet); -- cgit v1.2.3