diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-17 10:14:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-17 10:58:01 +0100 |
commit | 66f98136fd80bef92a8abde99d14585cf1d9e316 (patch) | |
tree | e08d54932403bfe80efc50fdf5db20c4b86837e0 /basic | |
parent | f162b156b03998bd695ed4f68bc03962a5299885 (diff) |
coverity#1210098 Uncaught exception
Change-Id: I531891fa1cce10a331dd651ee9ce52d1f8d0c169
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index ccc1490028cf..d51decdd80b3 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -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 ); |