mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix logging trying to open a null file
This commit is contained in:
parent
e90b8d2354
commit
18f27d5ee6
|
@ -127,6 +127,9 @@ void LogController::logToStdout(bool log) {
|
||||||
|
|
||||||
void LogController::setLogFile(const QString& file) {
|
void LogController::setLogFile(const QString& file) {
|
||||||
m_logStream.reset();
|
m_logStream.reset();
|
||||||
|
if (file.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
m_logFile = std::make_unique<QFile>(file);
|
m_logFile = std::make_unique<QFile>(file);
|
||||||
m_logFile->open(QIODevice::Append | QIODevice::Text);
|
m_logFile->open(QIODevice::Append | QIODevice::Text);
|
||||||
m_logStream = std::make_unique<QTextStream>(m_logFile.get());
|
m_logStream = std::make_unique<QTextStream>(m_logFile.get());
|
||||||
|
|
Loading…
Reference in New Issue