Bug 1532850 - Check the return value of LookAndFeel::GetInt() in case of the function failure. r=emilio
☠☠ backed out by 2eb9f5061586 ☠ ☠
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 09 Mar 2019 00:17:19 +0000
changeset 524211 8feadb1f48f21d9a024f3dec274f0c8e4cd7d26d
parent 524210 d1d79a31013760bf2dddd8d53d5b380a14fac8a3
child 524212 835fc236080c725919da936a1719b4e0bf541131
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1532850
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
layout/style/nsMediaFeatures.cpp
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -456,18 +456,19 @@ void nsMediaFeatures::InitSystemMetrics(
 
   rv = LookAndFeel::GetInt(LookAndFeel::eIntID_GTKCSDReversedPlacement,
                            &metricResult);
   if (NS_SUCCEEDED(rv) && metricResult) {
     sSystemMetrics->AppendElement(
         (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);
   }
 }
 
 /* static */
 void nsMediaFeatures::FreeSystemMetrics() {
   delete sSystemMetrics;