Skip to content

[Bug]Null Exception #3068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sanjivpurohit opened this issue Apr 5, 2022 · 1 comment · Fixed by #3070
Closed

[Bug]Null Exception #3068

sanjivpurohit opened this issue Apr 5, 2022 · 1 comment · Fixed by #3070
Labels
Milestone

Comments

@sanjivpurohit
Copy link

sanjivpurohit commented Apr 5, 2022

Describe the bug
Null Exception.
I am trying to generate a version on the branch. It works on the master.

Expected Behavior

Version must be generated.

Actual Behavior

Crashes with an exception

Possible Fix

Steps to Reproduce

Context

Your Environment

  • Version Used: gitversion-osx-arm64-5.9.1-beta1-43
  • Operating System and version (Windows 10, Ubuntu 18.04): Mac/Linux
  • Link to your project:
  • Link to your CI build (if appropriate):
  ERROR [04/04/22 21:18:52:16] An unexpected error occurred:
System.NullReferenceException: Object reference not set to an instance of an object.
   at GitVersion.RepositoryStore.<>c.<GetMergeCommitsForBranch>b__37_3(BranchCommit b) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Core/RepositoryStore.cs:line 504
   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at GitVersion.RepositoryStore.GetMergeCommitsForBranch(IBranch branch, Config configuration, IEnumerable`1 excludedBranches) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Core/RepositoryStore.cs:line 483
   at GitVersion.RepositoryStore.FindCommitBranchWasBranchedFrom(IBranch branch, Config configuration, IBranch[] excludedBranches) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Core/RepositoryStore.cs:line 321
   at GitVersion.Configuration.BranchConfigurationCalculator.InheritBranchConfiguration(Int32 recursions, IBranch targetBranch, BranchConfig branchConfiguration, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches)
   at GitVersion.Configuration.BranchConfigurationCalculator.GetBranchConfigurationInternal(Int32 recursions, IBranch targetBranch, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Configuration/BranchConfigurationCalculator.cs:line 54
   at GitVersion.Configuration.BranchConfigurationCalculator.GetBranchConfiguration(IBranch targetBranch, ICommit currentCommit, Config configuration, IList`1 excludedInheritBranches) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Configuration/BranchConfigurationCalculator.cs:line 28
   at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Core/GitVersionContextFactory.cs:line 38
   at GitVersion.GitVersionCoreModule.<>c__DisplayClass0_0.<RegisterTypes>b__1() in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/GitVersionCoreModule.cs:line 37
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at GitVersion.VersionCalculation.NextVersionCalculator.get_context() in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs:line 15
   at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs:line 30
   at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.Core/Core/GitVersionCalculateTool.cs:line 52
   at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in /Users/runner/work/GitVersion/GitVersion/src/GitVersion.App/GitVersionExecutor.cs:line 66
  INFO [04/04/22 21:18:52:16] Attempting to show the current git graph (please include in issue): 
  INFO [04/04/22 21:18:52:16] Showing max of 100 commits
  INFO [04/04/22 21:18:52:26] * 1aeae519 4 hours ago  (origin/ss/ps_enum)

@asbjornu Thanks for fixing the previous null exception and this is a new one with the latest build.

@asbjornu asbjornu mentioned this issue Apr 8, 2022
5 tasks
@asbjornu asbjornu added this to the 5.x milestone Apr 12, 2022
asbjornu added a commit that referenced this issue Apr 12, 2022

Verified

This commit was signed with the committer’s verified signature.
More `null` protection
@arturcic arturcic modified the milestones: 5.x, 5.10.0 Apr 14, 2022
@github-actions
Copy link

🎉 This issue has been resolved in version 5.10.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants