From kde-commits Fri Jul 18 17:00:39 2008 From: Maks Orlovich Date: Fri, 18 Jul 2008 17:00:39 +0000 To: kde-commits Subject: branches/KDE/4.1/kdelibs/khtml/ecma Message-Id: <1216400439.401645.16211.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=121640045217023 SVN commit 834328 by orlovich: Don't assume the body exists here; it doesn't have to in early inline scripts. Fixes crash on https://metanet.ucm.es CCBUG:166944 M +5 -5 kjs_html.cpp --- branches/KDE/4.1/kdelibs/khtml/ecma/kjs_html.cpp #834327:834328 @@ -393,15 +393,15 @@ case DesignMode: return jsString((doc.designMode() ? "on":"off")); case BgColor: - return jsString(body->getAttribute(ATTR_BGCOLOR)); + return jsString(body ? body->getAttribute(ATTR_BGCOLOR) : DOMString()); case FgColor: - return jsString(body->getAttribute(ATTR_TEXT)); + return jsString(body ? body->getAttribute(ATTR_TEXT) : DOMString()); case AlinkColor: - return jsString(body->getAttribute(ATTR_ALINK)); + return jsString(body ? body->getAttribute(ATTR_ALINK) : DOMString()); case LinkColor: - return jsString(body->getAttribute(ATTR_LINK)); + return jsString(body ? body->getAttribute(ATTR_LINK) : DOMString()); case VlinkColor: - return jsString(body->getAttribute(ATTR_VLINK)); + return jsString(body ? body->getAttribute(ATTR_VLINK) : DOMString()); case LastModified: return jsString(doc.lastModified()); case Height: // NS-only, not available in IE