https://bugs.webkit.org/show_bug.cgi?id=144366
<rdar://problem/
20533513>
Reviewed by Dean Jackson.
* rendering/RenderBlockFlow.cpp:
(WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
before attempting to dereference it.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183524
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-04-28 Brent Fulgham <bfulgham@apple.com>
+
+ REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
+ https://bugs.webkit.org/show_bug.cgi?id=144366
+ <rdar://problem/20533513>
+
+ Reviewed by Dean Jackson.
+
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
+ before attempting to dereference it.
+
2015-04-28 Andreas Kling <akling@apple.com>
Simplify DOM wrapper destruction, don't deref() in finalizers.
static inline bool needsAppleMailPaginationQuirk(RootInlineBox& lineBox)
{
- bool appleMailPaginationQuirkEnabled = lineBox.renderer().document().settings()->appleMailPaginationQuirkEnabled();
- if (appleMailPaginationQuirkEnabled && lineBox.renderer().element() && lineBox.renderer().element()->idForStyleResolution() == AtomicString("messageContentContainer", AtomicString::ConstructFromLiteral))
+ const auto& renderer = lineBox.renderer();
+
+ if (!renderer.document().settings())
+ return false;
+
+ if (!renderer.document().settings()->appleMailPaginationQuirkEnabled())
+ return false;
+
+ if (renderer.element() && renderer.element()->idForStyleResolution() == AtomicString("messageContentContainer", AtomicString::ConstructFromLiteral))
return true;
return false;