summaryrefslogtreecommitdiff
path: root/svl/source/notify/lstner.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/notify/lstner.cxx')
-rw-r--r--svl/source/notify/lstner.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index ee0809cd0db7..4fc3426b8bd4 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -68,7 +68,10 @@ SfxListener::~SfxListener()
void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBroadcaster )
{
- mpImpl->maBCs.erase( std::find( mpImpl->maBCs.begin(), mpImpl->maBCs.end(), &rBroadcaster ) );
+ auto it = std::find( mpImpl->maBCs.begin(), mpImpl->maBCs.end(), &rBroadcaster );
+ if (it != mpImpl->maBCs.end()) {
+ mpImpl->maBCs.erase( it );
+ }
}