diff --git a/kmtransport.cpp b/kmtransport.cpp index c0f623787..f8065d594 100644 --- a/kmtransport.cpp +++ b/kmtransport.cpp @@ -126,15 +126,15 @@ void KMTransportInfo::writeConfig(int id) if ( storePasswd() ) { // write password into the wallet if possible and necessary bool passwdStored = false; + Wallet *wallet = kmkernel->wallet(); if ( mPasswdDirty ) { - Wallet *wallet = kmkernel->wallet(); if ( wallet && wallet->writePassword( "transport-" + QString::number(mId), passwd() ) == 0 ) { passwdStored = true; mPasswdDirty = false; mStorePasswdInConfig = false; } } else { - passwdStored = !mStorePasswdInConfig; // already in the wallet + passwdStored = wallet ? !mStorePasswdInConfig /*already in the wallet*/ : config->hasKey("pass"); } // wallet not available, ask the user if we should use the config file instead if ( !passwdStored && ( mStorePasswdInConfig || KMessageBox::warningYesNo( 0,