mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
Preventing exceptions when monitoring shape templates
--HG-- branch : 1.x
This commit is contained in:
@@ -70,6 +70,9 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy {
|
||||
var basePath = Path.Combine(extensionDescriptor.Location, extensionDescriptor.Id).Replace(Path.DirectorySeparatorChar, '/');
|
||||
var virtualPath = Path.Combine(basePath, subPath).Replace(Path.DirectorySeparatorChar, '/');
|
||||
var fileNames = _cacheManager.Get(virtualPath, ctx => {
|
||||
if (!_virtualPathProvider.DirectoryExists(virtualPath))
|
||||
return new List<string>();
|
||||
|
||||
ctx.Monitor(_virtualPathMonitor.WhenPathChanges(virtualPath));
|
||||
return _virtualPathProvider.ListFiles(virtualPath).Select(Path.GetFileName).ToReadOnlyCollection();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user