Make sure that projection is an ol.proj.Projection instance

When a projection has no extent configured, the current code will fail because projection is a string. This pull request fixed that.
Look twice :-) It also took me some time to realize where was the change.