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 521213 8feadb1f48f2
parent 521212 d1d79a310137
child 521214 835fc236080c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [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;