From d1f9b94743114f7418a3e2aa59e6fb1bc2fe78af Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 22 Mar 2010 21:09:33 +0000 Subject: [PATCH] - Fixed: TMap::DelKey failed if the key's main position was nil, because it tried checking for it at the "next" position, which is an invalid pointer in that case. SVN r2236 (trunk) --- src/tarray.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tarray.h b/src/tarray.h index 92a6552e4..f93636f99 100644 --- a/src/tarray.h +++ b/src/tarray.h @@ -730,7 +730,11 @@ protected: Node *mp = MainPosition(key), **mpp; HashTraits Traits; - if (!mp->IsNil() && !Traits.Compare(mp->Pair.Key, key)) /* the key is in its main position */ + if (mp->IsNil()) + { + /* the key is definitely not present, because there is nothing at its main position */ + } + else if (!Traits.Compare(mp->Pair.Key, key)) /* the key is in its main position */ { if (mp->Next != NULL) /* move next node to its main position */ {