Fixed segmentation fault when logger failed to open log file

This commit is contained in:
Tatsuhiro Tsujikawa 2012-06-27 01:37:18 +09:00
parent 3ce6070107
commit a6775db3ca

View File

@ -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"));
}
}