Browse Source

ErrorUtils: don't crash if we fail to get the logger (r=toddw)

Mook 11 years ago
parent
commit
7162a0512b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      xpcom/src/ErrorUtils.cpp

+ 3 - 1
xpcom/src/ErrorUtils.cpp

@@ -113,7 +113,9 @@ void DoLogMessage(const char *methodName, const char *pszMessageText)
 		PyObject *logger = mod ?
 		                   PyObject_CallMethod(mod, "getLogger", "s", "xpcom") :
 		                   NULL;
-		PyObject *handlers = PyObject_GetAttrString(logger, "handlers");
+		PyObject *handlers = logger ?
+		                     PyObject_GetAttrString(logger, "handlers") :
+		                     NULL;
 		if (handlers)
 			initializedForLogging = PySequence_Check(handlers) &&
 			                        PySequence_Length(handlers) > 0;