Bug 1532850 - Check the return value of LookAndFeel::GetInt() in case of the function failure. r=emilio
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 19 Mar 2019 10:10:39 +0000
changeset 464977 e36b1516f12254855e4815afe07a015eedceca01
parent 464976 3f93af0603c657d533852321ae61a27d03ba8ddb
child 464978 ae4035f567c521ee01258c1c7bbe47110ac412e2
push id112486
push useropoprus@mozilla.com
push dateTue, 19 Mar 2019 16:41:04 +0000
treeherdermozilla-inbound@ee866fb50236 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1532850
milestone68.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
@@ -457,18 +457,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;