Committer: henrylyne
Fix error when layout layer is deleted but the style still is defined.Patch by afuna: http://changelog.dreamwidth.org/229197.html
U trunk/cgi-bin/LJ/Customize.pm
Modified: trunk/cgi-bin/LJ/Customize.pm =================================================================== --- trunk/cgi-bin/LJ/Customize.pm 2009-07-09 18:21:20 UTC (rev 15456) +++ trunk/cgi-bin/LJ/Customize.pm 2009-07-09 18:53:50 UTC (rev 15457) @@ -88,6 +88,14 @@ my $style = LJ::S2::load_style($u->prop('s2_style')); + unless ( $style && $style->{layer}->{layout} ) { + # we have no layout layer for this style, which causes errors in + # the customization interface + # undef current style and force them to use the site defaults + $u->set_prop( s2_style => 0 ); + $style = undef; + } + unless ($style && $style->{'userid'} == $u->{'userid'}) { my $theme; if ($LJ::DEFAULT_STYLE->{theme}) {