Checking null there is redundant since it will throw if it could not do encryption for some reason. I will remove that check.