bug 991: fix crash when the file is already cached