Fix location null provider

I don't like this fix, I must check why provider could be null because I'm not sure yet. But for now could be ok this fix.