when open document, check if provider is nil
Merge pull request #145 from ddysher/master

when open document, check if provider is nil