]> git.lyx.org Git - features.git/commitdiff
* segfault fix when deleting the last element from the tree
authorStefan Schimanski <sts@lyx.org>
Tue, 26 Feb 2008 00:38:41 +0000 (00:38 +0000)
committerStefan Schimanski <sts@lyx.org>
Tue, 26 Feb 2008 00:38:41 +0000 (00:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23239 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/weighted_btree.h

index d5d6c300c123acccaf87c446f8c60939e6274a47..42b3057611ac7ac92749e8ec0240ee7e9b647652 100644 (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];