Merge pull request #3247 from muemart/crash

Fix crash when loading an unsupported file
This commit is contained in:
James Rowe 2017-12-09 09:49:24 -07:00 committed by GitHub
commit a5b7a1fa7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,8 +487,6 @@ bool GMainWindow::LoadROM(const QString& filename) {
const Core::System::ResultStatus result{system.Load(render_window, filename.toStdString())}; const Core::System::ResultStatus result{system.Load(render_window, filename.toStdString())};
Core::Telemetry().AddField(Telemetry::FieldType::App, "Frontend", "Qt");
if (result != Core::System::ResultStatus::Success) { if (result != Core::System::ResultStatus::Success) {
switch (result) { switch (result) {
case Core::System::ResultStatus::ErrorGetLoader: case Core::System::ResultStatus::ErrorGetLoader:
@ -544,6 +542,8 @@ bool GMainWindow::LoadROM(const QString& filename) {
} }
return false; return false;
} }
Core::Telemetry().AddField(Telemetry::FieldType::App, "Frontend", "Qt");
return true; return true;
} }