BUG: don't try to deal with a dead cache refereant (GH5216)

closes #5216