diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp
index d0b3a2defe..a5fe8dcaea 100644
--- a/apps/launcher/maindialog.cpp
+++ b/apps/launcher/maindialog.cpp
@@ -531,6 +531,17 @@ bool MainDialog::writeSettings()
}
}
+ if(!mGameSettings.hasMaster()) {
+ QMessageBox msgBox;
+ msgBox.setWindowTitle(tr("Error writing OpenMW configuration file"));
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setStandardButtons(QMessageBox::Ok);
+ msgBox.setText(tr("
You do not have any master files selected.
\
+ Please select one and try again.
"));
+ msgBox.exec();
+ return false;
+ }
+
// Game settings
QFile file(userPath + QString("openmw.cfg"));
diff --git a/apps/launcher/settings/gamesettings.hpp b/apps/launcher/settings/gamesettings.hpp
index 7a17ef9af0..55b2107e2a 100644
--- a/apps/launcher/settings/gamesettings.hpp
+++ b/apps/launcher/settings/gamesettings.hpp
@@ -43,6 +43,7 @@ public:
inline QStringList getDataDirs() { return mDataDirs; }
inline void addDataDir(const QString &dir) { if(!dir.isEmpty()) mDataDirs.append(dir); }
inline QString getDataLocal() {return mDataLocal; }
+ inline bool hasMaster() { return mSettings.count(QString("master")) > 0; }
QStringList values(const QString &key, const QStringList &defaultValues = QStringList());
bool readFile(QTextStream &stream);