File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ namespace fex
164164 // Note: Using QFile instead of ifstream to handle encoding differences between platforms
165165 // (specifically to handle accented characters on Windows)
166166 QFile file (path);
167- file.open (QIODevice::ReadOnly);
167+ if (! file.open (QIODevice::ReadOnly)) return Lex ( );
168168
169169 const QByteArray data = file.readAll ();
170170
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ void logInit() {
189189 dir.mkpath (settingsPath);
190190 Log::path = dir.absoluteFilePath (QStringLiteral (" porymap.log" ));
191191 Log::file.setFileName (Log::path);
192- Log::file.open (QIODevice::WriteOnly | QIODevice::Append);
192+ if (! Log::file.open (QIODevice::WriteOnly | QIODevice::Append)) return ;
193193 Log::textStream.setDevice (&Log::file);
194194
195195 QObject::connect (&Log::displayClearTimer, &QTimer::timeout, [=] {
Original file line number Diff line number Diff line change @@ -708,9 +708,9 @@ void MainWindow::restoreWindowState() {
708708}
709709
710710void MainWindow::setTheme (QString theme) {
711- QFile File (QString (" :/themes/%1.qss" ).arg (theme));
712- File .open (QFile::ReadOnly);
713- QString stylesheet = QLatin1String (File .readAll ());
711+ QFile file (QString (" :/themes/%1.qss" ).arg (theme));
712+ if (!file .open (QFile::ReadOnly)) return ;
713+ QString stylesheet = QLatin1String (file .readAll ());
714714
715715 stylesheet.append (QString (" QWidget { %1 } " ).arg (Util::toStylesheetString (porymapConfig.applicationFont )));
716716 stylesheet.append (QString (" MapTree { %1 } " ).arg (Util::toStylesheetString (porymapConfig.mapListFont )));
You can’t perform that action at this time.
0 commit comments