Fix some probably-drunk-written code, less crashes and better checking
Fix some probably-drunk-written code, less crashes and better checking

Reviewed-by: Daniele E. Domenichelli

KDE/ktp-accounts-kcm,KDE/ktp-accounts-kcm,KDE/ktp-accounts-kcm