* segfault fix when deleting the last element from the tree

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23239 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2008-02-26 00:38:41 +00:00
parent 2e4848e082
commit 22d8e780f4

View File

@ -2306,9 +2306,9 @@ private:
// if the last key of the leaf was changed, the parent is notified
// and updates the key of this leaf
if (slot == leaf->slotuse)
if (slot == leaf->slotuse && parent)
{
if (parent && parentslot < parent->slotuse)
if (parentslot < parent->slotuse)
{
BTREE_ASSERT(parent->childid[parentslot] == curr);
parent->slotkey[parentslot] = leaf->slotkey[leaf->slotuse - 1];