Check for nil caches.
Merge pull request #218 from skydb/fix-nil-cache

Check for nil caches.