Fixed UrlService initialization

refs https://github.com/TryGhost/Toolbox/issues/135

- When there's no instance of cache available the code to retreive it should not execut. Duh!
This commit is contained in:
Naz 2021-11-19 15:28:48 +04:00 committed by naz
parent 9057ca0ee2
commit ae397eecdf

View File

@ -326,7 +326,7 @@ class UrlService {
let persistedUrls;
let persistedResources;
if (labs.isSet('urlCache') || urlCache) {
if (this.cache && (labs.isSet('urlCache') || urlCache)) {
persistedUrls = await this.cache.read('urls');
persistedResources = await this.cache.read('resources');
}