Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty maps to merge function #58

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

pselle
Copy link
Contributor

@pselle pselle commented Jun 22, 2020

Passing empty maps to MapVal panics. If we have an empty map after merging maps, return MapValEmpty so that we avoid this panic. Fixes hashicorp/terraform#25303

Passing empty maps to MapVal panics,
so check and return MapValEmpty if we
have an empty map to return
@codecov
Copy link

codecov bot commented Jun 22, 2020

Codecov Report

Merging #58 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #58   +/-   ##
=======================================
  Coverage   70.73%   70.74%           
=======================================
  Files          79       79           
  Lines        7176     7178    +2     
=======================================
+ Hits         5076     5078    +2     
  Misses       1659     1659           
  Partials      441      441           
Impacted Files Coverage Δ
cty/function/stdlib/collection.go 19.80% <100.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98cf8ce...6564e82. Read the comment docs.

@apparentlymart
Copy link
Collaborator

Makes sense to me. Thanks! 🎉

@apparentlymart apparentlymart merged commit edc8e82 into zclconf:master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic in function implementation: must not call MapVal with empty map
2 participants