Skip to content

Commit 3d749a1

Browse files
lukaszwawrzykjbedard
authored andcommitted
fix: correct early exit from _parse_lockfile
1 parent 7a8e980 commit 3d749a1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

npm/private/pnpm.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,12 @@ def _parse_lockfile(parsed, err):
589589
A tuple of (importers dict, packages dict, patched_dependencies dict, error string)
590590
"""
591591
if err != None or parsed == None or parsed == {}:
592-
return {}, {}, {}, err
592+
return {}, {}, {}, None, err
593593

594594
if not types.is_dict(parsed):
595-
return {}, {}, {}, "lockfile should be a starlark dict"
595+
return {}, {}, {}, None, "lockfile should be a starlark dict"
596596
if not parsed.get("lockfileVersion", False):
597-
return {}, {}, {}, "expected lockfileVersion key in lockfile"
597+
return {}, {}, {}, None, "expected lockfileVersion key in lockfile"
598598

599599
# Lockfile version may be a float such as 5.4 or a string such as '6.0'
600600
lockfile_version = str(parsed["lockfileVersion"])

npm/private/test/parse_pnpm_lock_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def _parse_empty_lock_test_impl(ctx):
88

99
parsed_json_a = pnpm.parse_pnpm_lock_json("")
1010
parsed_json_b = pnpm.parse_pnpm_lock_json("{}")
11-
expected = ({}, {}, {}, None)
11+
expected = ({}, {}, {}, None, None)
1212

1313
asserts.equals(env, expected, parsed_json_a)
1414
asserts.equals(env, expected, parsed_json_b)

0 commit comments

Comments
 (0)