Check for nil caches.

/cc @mkobetic @snormore