summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-17 16:56:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-17 16:59:53 +0200
commit543158edba6678d3d76eee983a9d4edd2a422fee (patch)
tree458133435b06afd5b50379c058a0f886fe9e82c1 /cppuhelper
parent6e78fd18c9ca2d70af93cad321f55f3d72172742 (diff)
Require XComponentContext.getServiceManager to throw instead of returning null
This is such a fatal error that there is probably no point in trying to handle it, so allow to simplify client code by removing the requirement to check for a null return value. Simplified some client code accordingly (modules configmgr and ure, and the code generated by cppumaker and javamaker). Change-Id: I51c0b270ec73409374f7439a47ee061407a46e31
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/source/component_context.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx
index a07cd0e8f302..ac416f1745f9 100644
--- a/cppuhelper/source/component_context.cxx
+++ b/cppuhelper/source/component_context.cxx
@@ -672,6 +672,12 @@ Any ComponentContext::getValueByName( OUString const & rName )
Reference< lang::XMultiComponentFactory > ComponentContext::getServiceManager()
throw (RuntimeException)
{
+ if ( !m_xSMgr.is() )
+ {
+ throw RuntimeException(
+ "null component context service manager",
+ static_cast<OWeakObject *>(this) );
+ }
return m_xSMgr;
}
//__________________________________________________________________________________________________