diff options
author | David Tardon <dtardon@redhat.com> | 2014-11-04 18:54:38 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-11-04 19:52:52 +0100 |
commit | 15492438f5dcb6e239c53d5c02d8ca442bd438a0 (patch) | |
tree | f95a48232d1b580ab484376701fd7647a882ad54 /package | |
parent | cd6e6712a18f45c92d6f915275b32964af887586 (diff) |
coverity#706578 uncaught exception
Change-Id: I70640f42db49da274118f7336ff072b1b53ac640
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 0b1193f45327..773fd79a84d5 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -5986,15 +5986,22 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openStreamEle uno::Reference< embed::XExtendedStorageStream > xResult; if ( aListPath.size() == 1 ) { - // that must be a direct request for a stream - // the transacted version of the stream should be opened + try + { + // that must be a direct request for a stream + // the transacted version of the stream should be opened - SotElement_Impl *pElement = OpenStreamElement_Impl( aStreamPath, nOpenMode, false ); - assert(pElement && pElement->m_pStream && "In case element can not be created an exception must be thrown!"); + SotElement_Impl *pElement = OpenStreamElement_Impl( aStreamPath, nOpenMode, false ); + assert(pElement && pElement->m_pStream && "In case element can not be created an exception must be thrown!"); - xResult = uno::Reference< embed::XExtendedStorageStream >( - pElement->m_pStream->GetStream( nOpenMode, true ), - uno::UNO_QUERY_THROW ); + xResult = uno::Reference< embed::XExtendedStorageStream >( + pElement->m_pStream->GetStream( nOpenMode, true ), + uno::UNO_QUERY_THROW ); + } + catch ( const container::NoSuchElementException & ) + { + throw io::IOException( THROW_WHERE ); // file not found + } } else { |