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,6 +1311,8 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
( !pLibInfo->IsExtern() || SotStorage::IsStorageFile( pLibInfo->GetStorageName() ) ) )
{
SotStorageRef xStorage;
try
{
if (!pLibInfo->IsExtern())
{
xStorage = new SotStorage(false, GetStorageName());
@@ -1319,8 +1321,13 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
{
xStorage = new SotStorage(false, pLibInfo->GetStorageName());
}
}
catch (const css::ucb::ContentCreationException& e)
{
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 );