Qt: Fix logging trying to open a null file

This commit is contained in:
Vicki Pfau 2019-05-21 07:17:42 -07:00
parent e90b8d2354
commit 18f27d5ee6
1 changed files with 3 additions and 0 deletions

View File

@ -127,6 +127,9 @@ void LogController::logToStdout(bool log) {
void LogController::setLogFile(const QString& file) {
m_logStream.reset();
if (file.isEmpty()) {
return;
}
m_logFile = std::make_unique<QFile>(file);
m_logFile->open(QIODevice::Append | QIODevice::Text);
m_logStream = std::make_unique<QTextStream>(m_logFile.get());