Fix when config is undefined.

Sometimes, the config is not provided in cache function. So, I fixed it.

#TypeError: Cannot read property 'config' of undefined