Skip to content
Permalink
Browse files

DolphinQt: Fix invalid error message when trying to save a zero-sized…

… game config.
  • Loading branch information...
jordan-woyak committed Mar 3, 2019
1 parent 4e5702d commit 2cec5d0a08efa4cb082c5b6ed5d87c59bbd63c04
Showing with 4 additions and 1 deletion.
  1. +4 −1 Source/Core/DolphinQt/Config/GameConfigEdit.cpp
@@ -121,11 +121,14 @@ void GameConfigEdit::SaveFile()
QFile file(m_path);

if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
{
QMessageBox::warning(this, tr("Warning"), tr("Failed to open config file!"));
return;
}

const QByteArray contents = m_edit->toPlainText().toUtf8();

if (!file.write(contents))
if (file.write(contents) == -1)
QMessageBox::warning(this, tr("Warning"), tr("Failed to write config file!"));
}

0 comments on commit 2cec5d0

Please sign in to comment.
You can’t perform that action at this time.