From 13b91169fde0fce632bb6d762b87353adb536aa7 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 23 Dec 2007 16:09:02 +0000 Subject: Protect
 fix in cases where c->style is NULL

svn path=/trunk/netsurf/; revision=3673
---
 render/layout.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/render/layout.c b/render/layout.c
index 9f05486f3..5704089b6 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -893,9 +893,11 @@ bool layout_inline_container(struct box *inline_container, int width,
 
 	has_text_children = false;
 	for (c = inline_container->children; c; c = c->next) {
-                bool is_pre = (c->style->white_space == CSS_WHITE_SPACE_PRE ||
-                               c->style->white_space == CSS_WHITE_SPACE_PRE_LINE ||
-                               c->style->white_space == CSS_WHITE_SPACE_PRE_WRAP);
+                bool is_pre = false;
+                if (c->style)
+                        is_pre = (c->style->white_space == CSS_WHITE_SPACE_PRE ||
+                                  c->style->white_space == CSS_WHITE_SPACE_PRE_LINE ||
+                                  c->style->white_space == CSS_WHITE_SPACE_PRE_WRAP);
 		if ((!c->object && c->text && (c->length || is_pre)) || c->type == BOX_BR)
                         has_text_children = true;
         }
-- 
cgit v1.2.3