diff --git a/rdf/base/src/nsContainerEnumerator.cpp b/rdf/base/src/nsContainerEnumerator.cpp index 7fd1b92a4d2..8537fc102c8 100644 --- a/rdf/base/src/nsContainerEnumerator.cpp +++ b/rdf/base/src/nsContainerEnumerator.cpp @@ -95,18 +95,13 @@ ContainerEnumeratorImpl::ContainerEnumeratorImpl(nsIRDFDataSource* aDataSource, if (gRefCnt++ == 0) { nsresult rv; - nsIRDFService* service; - rv = nsServiceManager::GetService(kRDFServiceCID, - nsIRDFService::GetIID(), - (nsISupports**) &service); - + NS_WITH_SERVICE(nsIRDFService, service, kRDFServiceCID, &rv); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to acquire resource manager"); - if (! service) + if (NS_FAILED(rv)) return; rv = service->GetResource(RDF_NAMESPACE_URI "nextVal", &kRDF_nextVal); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource"); - } }