Prevent variable masking

current_resource gets masked by a local variable if you use
current_resource = x without using self.

I also changed the assigned value to explicitly be nil in the error case.
I think that is what it gets set to anyway, but it seems less error prone to be explicit.