Reviewed by Hyatt
[WebKit-https.git] / WebCore / khtml / editing / htmlediting.cpp
index 4672abeb19ff252f22185f1821e47fd3662c5227..570bf1f99bee1bc6a86a417a94a546b07104a5f1 100644 (file)
@@ -4481,7 +4481,7 @@ void ReplaceSelectionCommand::doApply()
     // step 5 : mop up
     if (placeholderBlock) {
         document()->updateLayout();
-        if (!placeholderBlock->renderer() || placeholderBlock->renderer()->height() == 0)
+        if (placeholderBlock->inDocument() && (!placeholderBlock->renderer() || placeholderBlock->renderer()->height() == 0))
             removeNode(placeholderBlock);
     }
 }