there are more ways of not being a web context now
I don't think this is the fix, but it could help with #3115
Merge pull request #3116 from jlipps/master

there are more ways of not being a web context now