fix #3549: NPE when exporting invalid cache