cid#705118 Using invalid iterator

Change-Id: If90375ee49e71357482f86e31185c95774aef17c
Reviewed-on: https://gerrit.libreoffice.org/76092
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2019-07-22 08:35:18 +01:00
parent 4d02e8e96b
commit 5e752b318e

View File

@@ -208,7 +208,6 @@ HierarchyContentProvider::getConfigProvider(
return (*it).second.xConfigProvider; return (*it).second.xConfigProvider;
} }
uno::Reference< container::XHierarchicalNameAccess > uno::Reference< container::XHierarchicalNameAccess >
HierarchyContentProvider::getRootConfigReadNameAccess( HierarchyContentProvider::getRootConfigReadNameAccess(
const OUString & rServiceSpecifier ) const OUString & rServiceSpecifier )
@@ -216,8 +215,9 @@ HierarchyContentProvider::getRootConfigReadNameAccess(
osl::MutexGuard aGuard( m_aMutex ); osl::MutexGuard aGuard( m_aMutex );
ConfigProviderMap::iterator it = m_aConfigProviderMap.find( ConfigProviderMap::iterator it = m_aConfigProviderMap.find(
rServiceSpecifier ); rServiceSpecifier );
if ( it != m_aConfigProviderMap.end() ) if (it == m_aConfigProviderMap.end())
{ return uno::Reference< container::XHierarchicalNameAccess >();
if ( !( (*it).second.xRootReadAccess.is() ) ) if ( !( (*it).second.xRootReadAccess.is() ) )
{ {
if ( (*it).second.bTriedToGetRootReadAccess ) if ( (*it).second.bTriedToGetRootReadAccess )
@@ -261,12 +261,10 @@ HierarchyContentProvider::getRootConfigReadNameAccess(
"caught Exception!" ); "caught Exception!" );
} }
} }
}
return (*it).second.xRootReadAccess; return (*it).second.xRootReadAccess;
} }
uno::Reference< util::XOfficeInstallationDirectories > uno::Reference< util::XOfficeInstallationDirectories >
HierarchyContentProvider::getOfficeInstallationDirectories() HierarchyContentProvider::getOfficeInstallationDirectories()
{ {