Bug 1532850 - Check the return value of LookAndFeel::GetInt() in case of the function failure. r=emilio

Actually the function will fail on Android since on xpcshell tests we don't
initialize AndroidBridge so that we can't query the corresponding system
settings.

Differential Revision: https://phabricator.services.mozilla.com/D22270

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2019-03-18 22:57:42 +00:00
Родитель b360f74a7a
Коммит af3b3da60e
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -462,8 +462,9 @@ void nsMediaFeatures::InitSystemMetrics() {
(nsStaticAtom*)nsGkAtoms::_moz_gtk_csd_reversed_placement);
}
metricResult = LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme);
if (metricResult) {
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme,
&metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(
(nsStaticAtom*)nsGkAtoms::_moz_system_dark_theme);
}