summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2011-02-07 20:57:06 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2011-02-07 23:15:23 (GMT)
commit0126c4bf738229fedb1a5a1c05abf565b3131dce (patch)
tree3c127c3a7b15c9609d0c9a9d05350f7a7fea9df0
parent065ab288a86804e109e4886a07b1de61788135ab (diff)
Check for parent() to avoid crash
BUG: 264985
-rw-r--r--khtml/rendering/render_block.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/khtml/rendering/render_block.cpp b/khtml/rendering/render_block.cpp
index 39981d9..f9c718e 100644
--- a/khtml/rendering/render_block.cpp
+++ b/khtml/rendering/render_block.cpp
@@ -1667,7 +1667,7 @@ void RenderBlock::clearChildOfPageBreaks(RenderObject *child, PageBreakInfo &pag
bool doBreak = true;
// don't break before the first child or when page-break-inside is avoid
if (!forcePageBreak && (!style()->pageBreakInside() || m_avoidPageBreak || child == firstChild())) {
- if (parent()->canClear(this, (m_avoidPageBreak) ? PageBreakHarder : PageBreakNormal )) {
+ if (parent() && parent()->canClear(this, (m_avoidPageBreak) ? PageBreakHarder : PageBreakNormal )) {
#ifdef PAGE_DEBUG
kDebug(6040) << renderName() << "Avoid page-break inside";
#endif
@@ -1699,7 +1699,7 @@ void RenderBlock::clearChildOfPageBreaks(RenderObject *child, PageBreakInfo &pag
kDebug(6040) << "Page-break between children";
#endif
if (!style()->pageBreakInside() || m_avoidPageBreak) {
- if(parent()->canClear(this, (m_avoidPageBreak) ? PageBreakHarder : PageBreakNormal )) {
+ if (parent() && parent()->canClear(this, (m_avoidPageBreak) ? PageBreakHarder : PageBreakNormal )) {
#ifdef PAGE_DEBUG
kDebug(6040) << "Avoid page-break inside";
#endif