summaryrefslogtreecommitdiff
path: root/src/CommonAPI/Factory.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/Factory.hpp')
-rw-r--r--src/CommonAPI/Factory.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/CommonAPI/Factory.hpp b/src/CommonAPI/Factory.hpp
index 2f481f5..6ba73f6 100644
--- a/src/CommonAPI/Factory.hpp
+++ b/src/CommonAPI/Factory.hpp
@@ -19,7 +19,10 @@ Factory::buildProxy(const std::string& participantId,
const std::string& domain) {
std::shared_ptr<Proxy> abstractMiddlewareProxy = createProxy(_ProxyClass<_AttributeExtensions...>::getInterfaceId(), participantId, serviceName, domain);
- return std::make_shared<_ProxyClass<_AttributeExtensions...>>(abstractMiddlewareProxy);
+ if (abstractMiddlewareProxy) {
+ return std::make_shared<_ProxyClass<_AttributeExtensions...>>(abstractMiddlewareProxy);
+ }
+ return NULL;
}
template<template<typename ...> class _ProxyClass, typename ... _AttributeExtensions >
@@ -43,7 +46,10 @@ Factory::buildProxyWithDefaultAttributeExtension(const std::string& participantI
const std::string& domain) {
std::shared_ptr<Proxy> abstractMiddlewareProxy = createProxy(DefaultAttributeProxyFactoryHelper<_ProxyClass, _AttributeExtension>::class_t::getInterfaceId(), participantId, serviceName, domain);
- return std::make_shared<typename DefaultAttributeProxyFactoryHelper<_ProxyClass, _AttributeExtension>::class_t>(abstractMiddlewareProxy);
+ if (abstractMiddlewareProxy) {
+ return std::make_shared<typename DefaultAttributeProxyFactoryHelper<_ProxyClass, _AttributeExtension>::class_t>(abstractMiddlewareProxy);
+ }
+ return NULL;
}
template <template<typename ...> class _ProxyClass, template<typename> class _AttributeExtension>