From 7f33b7b83320f8d6c9cb40f7d5d9d9842a22e8f8 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Mon, 11 May 2020 11:46:44 +0300 Subject: Add try-catch block for ProductKeyCheck initialization Change-Id: I04811666c3d26d46e4253a8673643c026851e07f Reviewed-by: Katja Marttila --- src/sdk/sdkapp.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sdk') diff --git a/src/sdk/sdkapp.h b/src/sdk/sdkapp.h index 5e5e526b4..dc4641f24 100644 --- a/src/sdk/sdkapp.h +++ b/src/sdk/sdkapp.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -293,7 +294,12 @@ public: m_core->acceptMessageBoxDefaultButton(); } - ProductKeyCheck::instance()->init(m_core); + try { + ProductKeyCheck::instance()->init(m_core); + } catch (const QInstaller::Error &e) { + errorMessage = e.message(); + return false; + } ProductKeyCheck::instance()->addPackagesFromXml(QLatin1String(":/metadata/Updates.xml")); return true; -- cgit v1.2.3