Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: do not panic on empty jsonl inputs
buildPlan.instances always returned an iterator with at least one instance, and in the case of an empty jsonl file, this would result in iterating over a single nil instance. This would cause the following logic, like exporting, to panic. An empty jsonl input means zero files, and is allowed by the spec. Moreover, zero bytes is not valid input, unlike YAML or TOML, which produce null and {} respectively. For these reasons, treat empty jsonl inputs as a stream of zero values. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Ie0a62bb59d347011de5aa47f5ee6d175824451a3 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199451 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information