Fix a crash in cache.