[users] Protect against JobQueue or GS being NULL
- Avoid SIGSEGV in tests, make sure JobQueue exists, GS optional
This commit is contained in:
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…
Reference in New Issue
Block a user