From: Csaba Osztrogonác <ossy@webkit.org>
Subject: Check for NULL pointer in ApplyStyleCommand
Origin: http://trac.webkit.org/changeset/176182
Index: webkitgtk/Source/WebCore/editing/ApplyStyleCommand.cpp
===================================================================
--- webkitgtk.orig/Source/WebCore/editing/ApplyStyleCommand.cpp
+++ webkitgtk/Source/WebCore/editing/ApplyStyleCommand.cpp
@@ -257,6 +257,9 @@ void ApplyStyleCommand::applyBlockStyle(
     // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoints.
     // Calculate start and end indices from the start of the tree that they're in.
     Node* scope = highestEditableRoot(visibleStart.deepEquivalent());
+    if (!scope)
+        return;
+
     RefPtr<Range> startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent());
     RefPtr<Range> endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent());
     int startIndex = TextIterator::rangeLength(startRange.get(), true);
