[users] Protect against JobQueue or GS being NULL

- Avoid SIGSEGV in tests, make sure JobQueue exists, GS optional
main
Adriaan de Groot 4 years ago
parent 788a233319
commit 6b2d7f6a42

@ -34,6 +34,11 @@ static void
updateGSAutoLogin( bool doAutoLogin, const QString& login )
{
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
if ( !gs )
{
cWarning() << "No Global Storage available";
return;
}
if ( doAutoLogin && !login.isEmpty() )
{

@ -53,6 +53,11 @@ UserTests::initTestCase()
{
Logger::setupLogLevel( Logger::LOGDEBUG );
cDebug() << "Users test started.";
if ( !Calamares::JobQueue::instance() )
{
(void)new Calamares::JobQueue();
}
}
void

Loading…
Cancel
Save