Bug 874391 - Missing nullchecks in nsNativeTheme::IsDarkBackground(nsIFrame*), r=roc

--HG--
extra : rebase_source : e9161f3fbce9b53e4c74314cc94fb9556f7a9548
This commit is contained in:
Gijs Kruitbosch 2013-05-21 16:27:31 +02:00
parent cffc4ca1cb
commit 123ce9b924

View File

@ -682,11 +682,14 @@ nsNativeTheme::IsRangeHorizontal(nsIFrame* aFrame)
bool
nsNativeTheme::IsDarkBackground(nsIFrame* aFrame)
{
nsIScrollableFrame* scrollFrame = aFrame->GetScrollTargetFrame();
nsIScrollableFrame* scrollFrame = nullptr;
while (!scrollFrame && aFrame) {
aFrame = aFrame->GetParent();
scrollFrame = aFrame->GetScrollTargetFrame();
aFrame = aFrame->GetParent();
}
if (!scrollFrame)
return false;
nsIFrame* frame = scrollFrame->GetScrolledFrame();
nsStyleContext* bgSC;
if (nsCSSRendering::FindBackground(frame, &bgSC)) {