If encrypted is null, an error has occurred. I don't see how an exception would be thrown.  Although, I suspect that a layer below would have thrown.