Skip to content

SemVersion class crashes if compared to null #3743

@nikola-nignite

Description

@nikola-nignite

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

2.0.0

Operating system

Windows

Operating system architecture

64-Bit

CI Server

No response

What are you seeing?

I used SemVersion class of Cake to handle versioning (due to inability to use NuGet.Versioning package; unrelated bug in Cake.Bakery).

At one point I compared a SemVersion variable to null, which causes it to crash with ObjectNullReferenceException. I resolved it by using SemVersion.Zero instead so far.

What is expected?

Comparing a SemVersion object to null returns false.

Steps to Reproduce

SemVersion version = null;
if (version == null) // Here script crashes
version = new ....

Output log

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions