From 8ca3bbaaab0d9bc4fff9413ebdc2d0016c96eddf Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Mon, 28 Jan 2013 01:57:45 -0500 Subject: [PATCH] Do not try to log to a null logger (can happen during Thread::staticShutdown) --- include/mitsuba/core/logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mitsuba/core/logger.h b/include/mitsuba/core/logger.h index 8e7c1f15..f3fd5846 100644 --- a/include/mitsuba/core/logger.h +++ b/include/mitsuba/core/logger.h @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN if (EXPECT_NOT_TAKEN(thread == NULL)) \ throw std::runtime_error("Null thread pointer"); \ mitsuba::Logger *logger = thread->getLogger(); \ - if (level >= logger->getLogLevel()) \ + if (logger != NULL && level >= logger->getLogLevel()) \ logger->log(level, m_theClass, \ __FILE__, __LINE__, fmt, ## __VA_ARGS__); \ } while (0) @@ -51,7 +51,7 @@ MTS_NAMESPACE_BEGIN if (EXPECT_NOT_TAKEN(thread == NULL)) \ throw std::runtime_error("Null thread pointer"); \ mitsuba::Logger *logger = thread->getLogger(); \ - if (level >= logger->getLogLevel()) \ + if (logger != NULL && level >= logger->getLogLevel()) \ logger->log(level, NULL, \ __FILE__, __LINE__, fmt, ## __VA_ARGS__); \ } while (0)