Prevent crash from uninitialized telemetry

This commit is contained in:
James Rowe 2018-04-07 07:25:14 -06:00
parent 37041ea12c
commit 222ba939f2

View File

@ -347,8 +347,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:
@ -409,6 +407,7 @@ bool GMainWindow::LoadROM(const QString& filename) {
} }
return false; return false;
} }
Core::Telemetry().AddField(Telemetry::FieldType::App, "Frontend", "Qt");
return true; return true;
} }