Skip to content

Commit

Permalink
fix: don't crash on lockfile with no packages field
Browse files Browse the repository at this point in the history
close #5553
  • Loading branch information
zkochan committed Oct 26, 2022
1 parent aacb83f commit d37ff60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/small-ads-warn.md
@@ -0,0 +1,6 @@
---
"@pnpm/resolve-dependencies": patch
"pnpm": patch
---

Don't crash on lockfile with no packages field [#5553](https://github.com/pnpm/pnpm/issues/5553).
4 changes: 2 additions & 2 deletions packages/resolve-dependencies/src/index.ts
Expand Up @@ -332,8 +332,8 @@ async function finishLockfileUpdates (

// TODO: try to cover with unit test the case when entry is no longer available in lockfile
// It is an edge that probably happens if the entry is removed during lockfile prune
if (requiresBuild && newLockfile.packages![depPath]) {
newLockfile.packages![depPath].requiresBuild = true
if (requiresBuild && newLockfile.packages?.[depPath]) {
newLockfile.packages[depPath].requiresBuild = true
}
}))
}
Expand Down

0 comments on commit d37ff60

Please sign in to comment.