Skip to content

Prevent null reference exception with null Platform when using AL task#7102

Merged
rainersigwald merged 1 commit into
dotnet:mainfrom
Forgind:al-fix
Dec 1, 2021
Merged

Prevent null reference exception with null Platform when using AL task#7102
rainersigwald merged 1 commit into
dotnet:mainfrom
Forgind:al-fix

Conversation

@Forgind
Copy link
Copy Markdown
Contributor

@Forgind Forgind commented Dec 1, 2021

Fixes #7101

Context

The AL task's Platform property is used to find the architecture, but it can be null. If it is, we should just use the current process architecture. Instead, we were throwing a null reference exception after #7051.

Changes Made

Switch to yoda condition. Prevents NRE.

Testing

None

@rainersigwald rainersigwald added this to the VS 17.1 milestone Dec 1, 2021
@rainersigwald rainersigwald added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Dec 1, 2021
@rainersigwald rainersigwald merged commit 01e6196 into dotnet:main Dec 1, 2021
@benvillalobos
Copy link
Copy Markdown
Member

👋 Thanks for handling this while I was out

@Forgind Forgind deleted the al-fix branch December 6, 2021 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.NullReferenceException from AL task in Microsoft.Build.Tasks.Core

3 participants