[users] Protect against a nullptr deref

- there is typically no GS during tests
This commit is contained in:
Adriaan de Groot 2020-08-18 17:20:08 +02:00
parent 4b4d7f3b10
commit ab3e393d45

View File

@ -83,7 +83,11 @@ Config::setUserShell( const QString& shell )
return; return;
} }
// The shell is put into GS because the CreateUser job expects it there // The shell is put into GS because the CreateUser job expects it there
Calamares::JobQueue::instance()->globalStorage()->insert( "userShell", shell ); auto* gs = Calamares::JobQueue::instance()->globalStorage();
if ( gs )
{
gs->insert( "userShell", shell );
}
} }
static inline void static inline void