[users] Avoid crashes in tests due to nullptr GS
This commit is contained in:
parent
cd8c3089cb
commit
63196ab58f
@ -66,6 +66,10 @@ STATICTEST QStringList
|
||||
groupsInTargetSystem()
|
||||
{
|
||||
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||
if ( !gs )
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
QDir targetRoot( gs->value( "rootMountPoint" ).toString() );
|
||||
|
||||
QFileInfo groupsFi( targetRoot.absoluteFilePath( "etc/group" ) );
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "CreateUserJob.h"
|
||||
|
||||
#include "JobQueue.h"
|
||||
#include "utils/Logger.h"
|
||||
|
||||
#include <QDir>
|
||||
@ -37,6 +38,10 @@ GroupTests::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