There are consumers of nsContentUtils::GetPrefBranch which don't null-check the result. This is bad, as nsContentUtils::Init explicitly states that a null pref service is allowed. 484de288-23dc-4490-ad28-8eff22110217 is an example of a crash because of this. Consumers requiring fixing: http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsImageFrame.cpp#1904 http://mxr.mozilla.org/mozilla-central/source/dom/base/nsFocusManager.cpp#197
Should the nsFocusManager instance return NS_ERROR_FAILURE or just if(prefBranch) ?
I think a straight |if (prefBranch)| will be fine.
Created attachment 524869 [details] [diff] [review] Patch v1 Thanks. Ideas for who to review?
Comment on attachment 524869 [details] [diff] [review] Patch v1 I think jst's a good candidate here.
6 years ago
And thanks, Ed! http://hg.mozilla.org/mozilla-central/rev/1c62fb90d4dd
No worries, thanks for the checkin :-)
All instances of: http://mxr.mozilla.org/mozilla-central/search?string=nsContentUtils::GetPrefBranch%28%29 ...null check prefBranch. -> Verified.