From ab3e393d45367ef64e5b0e5ae97a0b878c5c99e5 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 18 Aug 2020 17:20:08 +0200 Subject: [PATCH] [users] Protect against a nullptr deref - there is typically no GS during tests --- src/modules/users/Config.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index 80c612171..de246950f 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -83,7 +83,11 @@ Config::setUserShell( const QString& shell ) return; } // 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