Prevent an unnecessary exception to be thrown

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-03-31 12:51:04 -07:00
parent 95b4b6e333
commit 545a9cdfa9

View File

@@ -73,6 +73,10 @@ namespace Orchard.FileSystems.VirtualPath {
}
private void BindSignal(string virtualPath, CacheItemRemovedCallback callback) {
if(!HostingEnvironment.VirtualPathProvider.DirectoryExists(virtualPath)) {
return;
}
var cacheDependency = HostingEnvironment.VirtualPathProvider.GetCacheDependency(
virtualPath,
new[] { virtualPath },