From 5703a3619b09116b83a448ce97cf24e8fcdac027 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Sat, 7 Oct 2006 22:29:06 +0000 Subject: [PATCH] Don't try to erase a key that isn't there. BUG:134726 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@593479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- taglib/toolkit/tmap.tcc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taglib/toolkit/tmap.tcc b/taglib/toolkit/tmap.tcc index e2755d6f..765df50e 100644 --- a/taglib/toolkit/tmap.tcc +++ b/taglib/toolkit/tmap.tcc @@ -134,7 +134,9 @@ template Map &Map::erase(const Key &key) { detach(); - d->map.erase(find(key)); + Iterator it = d->map.find(key); + if(it != d->map.end()) + d->map.erase(it); return *this; }