nullpointer check in KeychainProvider