diff options
Diffstat (limited to 'sc/source/ui/unoobj/dapiuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index feb8b4c744fd..07c269384aa0 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -2697,8 +2697,16 @@ Reference< XDataPilotField > SAL_CALL ScDataPilotFieldObj::createNameGroup( cons Reference< XNameAccess > xFields(mrParent.getDataPilotFields(), UNO_QUERY); if (xFields.is()) { - xRet.set(xFields->getByName(sNewDim), UNO_QUERY); - OSL_ENSURE(xRet.is(), "there is a name, so there should be also a field"); + try + { + xRet.set(xFields->getByName(sNewDim), UNO_QUERY); + OSL_ENSURE(xRet.is(), "there is a name, so there should be also a field"); + } + catch (const container::NoSuchElementException&) + { + // Avoid throwing exception that's not specified in the method signature. + throw RuntimeException(); + } } } return xRet; |