[plasma/kscreenlocker] greeter: greeter: don't crash if the authenticator is null

Xaver Hugl <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 63dd6d0e5ca3ee8cc2c46098c5cefb7b627285a1 by Xaver Hugl.
Committed on 18/08/2026 at 15:17.
Pushed by zamundaaa into branch 'master'.

greeter: don't crash if the authenticator is null

This happens for a short time on startup

M  +6    -6    greeter/pamauthenticators.cpp

https://invent.kde.org/plasma/kscreenlocker/-/commit/63dd6d0e5ca3ee8cc2c46098c5cefb7b627285a1

diff --git a/greeter/pamauthenticators.cpp b/greeter/pamauthenticators.cpp
index 1ed81c5c..ec3375be 100644
--- a/greeter/pamauthenticators.cpp
+++ b/greeter/pamauthenticators.cpp
@@ -264,32 +264,32 @@ void PamAuthenticators::onAuthenticatorChanged()
 
 bool PamAuthenticators::isBusy() const
 {
-    return d->m_activeAuthenticator->isBusy();
+    return d->m_activeAuthenticator && d->m_activeAuthenticator->isBusy();
 }
 
 bool PamAuthenticators::inPasswordDelay() const
 {
-    return d->m_activeAuthenticator->inPasswordDelay();
+    return d->m_activeAuthenticator && d->m_activeAuthenticator->inPasswordDelay();
 }
 
 QString PamAuthenticators::prompt() const
 {
-    return d->m_activeAuthenticator->getPrompt();
+    return d->m_activeAuthenticator ? d->m_activeAuthenticator->getPrompt() : QString();
 }
 
 QString PamAuthenticators::promptForSecret() const
 {
-    return d->m_activeAuthenticator->getPromptForSecret();
+    return d->m_activeAuthenticator ? d->m_activeAuthenticator->getPromptForSecret() : QString();
 }
 
 QString PamAuthenticators::infoMessage() const
 {
-    return d->m_activeAuthenticator->getInfoMessage();
+    return d->m_activeAuthenticator ? d->m_activeAuthenticator->getInfoMessage() : QString();
 }
 
 QString PamAuthenticators::errorMessage() const
 {
-    return d->m_activeAuthenticator->getErrorMessage();
+    return d->m_activeAuthenticator ? d->m_activeAuthenticator->getErrorMessage() : QString();
 }
 
 void PamAuthenticators::respond(const QByteArray &response)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.