[libcalamares] Don't crash when creating System object

- In tests, a System object might be created without first
   setting up a JobQueue. In that case, there's no instance,
   so no GS to insert into. Avoid crash here.
main
Adriaan de Groot 6 years ago
parent 39d618c61e
commit 76ce0e4f2b

@ -85,8 +85,10 @@ System::System( bool doChroot, QObject* parent )
{
Q_ASSERT( !s_instance );
s_instance = this;
if ( !doChroot )
if ( !doChroot && Calamares::JobQueue::instance() && Calamares::JobQueue::instance()->globalStorage() )
{
Calamares::JobQueue::instance()->globalStorage()->insert( "rootMountPoint", "/" );
}
}

Loading…
Cancel
Save