Skip to content

Commit

Permalink
Handle runtime being null
Browse files Browse the repository at this point in the history
Handle an SDK release not having a runtime associated with it.
  • Loading branch information
martincostello committed Aug 23, 2023
1 parent 568c2d6 commit 91a0864
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/DotNetSdkUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class DotNetSdkUpdater {
if (patchDelta > 1) {
for (let patch = currentPatch; patch < latestPatch; patch++) {
const version = `${versionMajor}.${versionMinor}.${patch}`;
const release = channel.releases.find((p) => p.runtime.version === version);
const release = channel.releases.find((p) => p.runtime?.version === version);
if (release) {
result.security = result.security || release.security;
if (release['cve-list']) {
Expand Down
1 change: 1 addition & 0 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ActionFixture } from './ActionFixture';

describe('update-dotnet-sdk', () => {
describe.each([
['2.1.500', '', '2.1', 'Update .NET SDK'],
['3.1.201', '', '3.1', 'Update .NET SDK'],
['3.1.201', 'chore:', '3.1', 'chore: Update .NET SDK'],
['6.0.100', '', '6.0', 'Update .NET SDK'],
Expand Down

0 comments on commit 91a0864

Please sign in to comment.