Explorar o código

Fixed null pointer access if plog is not initialized

Paul-Louis Ageneau %!s(int64=5) %!d(string=hai) anos
pai
achega
b538e454aa
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/icetransport.cpp

+ 2 - 1
src/icetransport.cpp

@@ -60,7 +60,8 @@ IceTransport::IceTransport(const Configuration &config, Description::Role role,
 	}
 
 	juice_log_level_t level;
-	switch (plog::get()->getMaxSeverity()) {
+	auto logger = plog::get();
+	switch (logger ? logger->getMaxSeverity() : plog::none) {
 	case plog::none:
 		level = JUICE_LOG_LEVEL_NONE;
 		break;