From 16b54d6fc300112e03adf30511ffec5b5add3474 Mon Sep 17 00:00:00 2001 From: Salih Date: Mon, 26 Sep 2022 09:16:06 +0300 Subject: [PATCH] Project.ExtraProperties["VersionBranchPrefix"] Null check --- .../src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index c68d25d1e8..b640e05883 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -369,9 +369,9 @@ namespace Volo.Docs.Pages.Documents.Project return version; } - var prefix = Project.ExtraProperties["VersionBranchPrefix"].ToString(); + var prefix = Project.ExtraProperties["VersionBranchPrefix"]?.ToString(); - if (string.IsNullOrWhiteSpace(version) || !version.StartsWith(prefix) || version.Length <= prefix.Length) + if (string.IsNullOrWhiteSpace(version) || string.IsNullOrWhiteSpace(prefix) || !version.StartsWith(prefix) || version.Length <= prefix.Length) { return version; }