From d712dff38fd440a13fcb221c63b6fa9f17aaf6f4 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 25 Nov 2018 18:55:18 -0800 Subject: [PATCH] Fix NRE thrown when version property is missing Fixes #250 --- src/NerdBank.GitVersioning/VersionOracle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NerdBank.GitVersioning/VersionOracle.cs b/src/NerdBank.GitVersioning/VersionOracle.cs index 58b865c8..8b5c9cd7 100644 --- a/src/NerdBank.GitVersioning/VersionOracle.cs +++ b/src/NerdBank.GitVersioning/VersionOracle.cs @@ -98,7 +98,7 @@ public VersionOracle(string projectDirectory, LibGit2Sharp.Repository repo, LibG this.VersionHeightOffset = this.VersionOptions?.BuildNumberOffsetOrDefault ?? 0; - this.PrereleaseVersion = this.ReplaceMacros(this.VersionOptions?.Version.Prerelease ?? string.Empty); + this.PrereleaseVersion = this.ReplaceMacros(this.VersionOptions?.Version?.Prerelease ?? string.Empty); this.CloudBuildNumberOptions = this.VersionOptions?.CloudBuild?.BuildNumberOrDefault ?? VersionOptions.CloudBuildNumberOptions.DefaultInstance;