diff --git a/src/main.cpp b/src/main.cpp index 919a3de52..073d116af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -340,8 +341,15 @@ int main(int argc, char* argv[]) // Autologin // TODO (kriby): Shift responsibility of linking views to model objects from nexus // Further: generate view instances separately (loginScreen, mainGUI, audio) + Profile* profile = nullptr; if (autoLogin && Profile::exists(profileName) && !Profile::isEncrypted(profileName)) { - Profile* profile = Profile::loadProfile(profileName, QString(), settings); + profile = Profile::loadProfile(profileName, QString(), settings); + if (!profile) { + QMessageBox::information(nullptr, QObject::tr("Error"), + QObject::tr("Failed to load profile automatically.")); + } + } + if (profile) { settings.updateProfileData(profile); nexus.bootstrapWithProfile(profile); } else {