From a2ff51dc7d6c6f9188f09bd7270042cfb6a3a132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 12 Mar 2021 22:59:09 +0300 Subject: [PATCH] Better exception message. --- .../Volo/Abp/Cli/Bundling/BundlerBase.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); }