Commit 2e876d1
authored
fix: properly handle missing algorithm type (#48)
Fixing a bug that happen in npm cli when I install a library.
in Line 272 the result of parse can be null if integrity is null. Then in line 273 other is null so it breaks as below:
```
TypeError: Cannot read properties of null (reading 'pickAlgorithm')
npm verb stack at Integrity.match (/usr/lib/node_modules/npm/node_modules/ssri/lib/index.js:273:24)
npm verb stack at CachePolicy.satisfies (/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/cache/policy.js:112:49)
npm verb stack at Function.find (/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/cache/entry.js:178:25)
npm verb stack at async cacheFetch (/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/cache/index.js:8:17)
npm verb stack at async fetch (/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/fetch.js:98:7)
```1 parent dd14735 commit 2e876d1
2 files changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
0 commit comments