coverity#1210098 Uncaught exception

Change-Id: I531891fa1cce10a331dd651ee9ce52d1f8d0c169
This commit is contained in:
Caolán McNamara
2014-06-17 10:14:04 +01:00
parent f162b156b0
commit 66f98136fd

View File

@@ -1311,16 +1311,23 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
( !pLibInfo->IsExtern() || SotStorage::IsStorageFile( pLibInfo->GetStorageName() ) ) )
{
SotStorageRef xStorage;
if ( !pLibInfo->IsExtern() )
try
{
xStorage = new SotStorage( false, GetStorageName() );
if (!pLibInfo->IsExtern())
{
xStorage = new SotStorage(false, GetStorageName());
}
else
{
xStorage = new SotStorage(false, pLibInfo->GetStorageName());
}
}
else
catch (const css::ucb::ContentCreationException& e)
{
xStorage = new SotStorage( false, pLibInfo->GetStorageName() );
SAL_WARN( "basic", "BasicManager::RemoveLib: Caught exception: " << e.Message );
}
if ( xStorage->IsStorage( OUString(szBasicStorage) ) )
if (xStorage.Is() && xStorage->IsStorage(OUString(szBasicStorage)))
{
SotStorageRef xBasicStorage = xStorage->OpenSotStorage
( OUString(szBasicStorage), STREAM_STD_READWRITE, sal_False );