Keyguard: LN: fix and harden against null pointer exceptions