summaryrefslogtreecommitdiff
path: root/unotools/source/config/configitem.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/config/configitem.cxx')
-rw-r--r--unotools/source/config/configitem.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index a6785079723a..60ded67dc837 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -537,19 +537,19 @@ bool ConfigItem::EnableNotification(const Sequence< OUString >& rNames,
void ConfigItem::RemoveChangesListener()
{
Reference<XHierarchicalNameAccess> xHierarchyAccess = GetTree();
- if(xHierarchyAccess.is())
+ if(!xHierarchyAccess.is())
+ return;
+
+ Reference<XChangesNotifier> xChgNot(xHierarchyAccess, UNO_QUERY);
+ if(xChgNot.is() && xChangeLstnr.is())
{
- Reference<XChangesNotifier> xChgNot(xHierarchyAccess, UNO_QUERY);
- if(xChgNot.is() && xChangeLstnr.is())
+ try
+ {
+ xChgNot->removeChangesListener( xChangeLstnr );
+ xChangeLstnr = nullptr;
+ }
+ catch (const Exception&)
{
- try
- {
- xChgNot->removeChangesListener( xChangeLstnr );
- xChangeLstnr = nullptr;
- }
- catch (const Exception&)
- {
- }
}
}
}