[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()
|
groupsInTargetSystem()
|
||||||
{
|
{
|
||||||
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
if ( !gs )
|
||||||
|
{
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
QDir targetRoot( gs->value( "rootMountPoint" ).toString() );
|
QDir targetRoot( gs->value( "rootMountPoint" ).toString() );
|
||||||
|
|
||||||
QFileInfo groupsFi( targetRoot.absoluteFilePath( "etc/group" ) );
|
QFileInfo groupsFi( targetRoot.absoluteFilePath( "etc/group" ) );
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "CreateUserJob.h"
|
#include "CreateUserJob.h"
|
||||||
|
|
||||||
|
#include "JobQueue.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@ -37,6 +38,10 @@ GroupTests::initTestCase()
|
|||||||
{
|
{
|
||||||
Logger::setupLogLevel( Logger::LOGDEBUG );
|
Logger::setupLogLevel( Logger::LOGDEBUG );
|
||||||
cDebug() << "Users test started.";
|
cDebug() << "Users test started.";
|
||||||
|
if ( !Calamares::JobQueue::instance() )
|
||||||
|
{
|
||||||
|
(void)new Calamares::JobQueue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user