Assert that the passed 'cache' is not NULL.  This should be turned
into asserts in the future.

(cherry picked from commit 69b384d6e7ec747bc88943ef2d6ee3e43a167ee0)