diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs index 4145c34e68..97ef628d5a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs @@ -74,8 +74,13 @@ namespace Volo.Abp.Cli.Bundling { var pathFragments = definition.Source.Split('/').ToList(); var basePath = $"{pathFragments[0]}/{pathFragments[1]}"; - var path = staticAssetsDefinitions.SelectSingleNode($"//ContentRoot[@BasePath='{basePath}']") - .Attributes["Path"].Value; + var node = staticAssetsDefinitions.SelectSingleNode($"//ContentRoot[@BasePath='{basePath}']"); + if (node == null || node.Attributes == null) + { + throw new AbpException("Not found: " + definition.Source); + } + + var path = node.Attributes["Path"].Value; var absolutePath = definition.Source.Replace(basePath, path); content = GetFileContent(absolutePath, options.Minify); }