Ver código fonte

Fixed segmentation fault when logger failed to open log file

Tatsuhiro Tsujikawa 13 anos atrás
pai
commit
a6775db3ca
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      src/Logger.cc

+ 1 - 1
src/Logger.cc

@@ -76,7 +76,7 @@ void Logger::openFile(const std::string& filename)
     fpp_ = global::cout();
   } else {
     fpp_.reset(new BufferedFile(filename, BufferedFile::APPEND));
-    if(!fpp_) {
+    if(!*static_cast<BufferedFile*>(fpp_.get())) {
       throw DL_ABORT_EX(fmt(EX_FILE_OPEN, filename.c_str(), "n/a"));
     }
   }