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

Fix tagging with empty data #3102

Merged
merged 2 commits into from
Sep 4, 2023
Merged

Fix tagging with empty data #3102

merged 2 commits into from
Sep 4, 2023

Conversation

TonyCTHsu
Copy link
Contributor

fixes #3088

What does this PR do?

An object includes Tagging module, but #tags method raise NoMethodError: undefined method 'merge' for nil:NilClass or TypeError: no implicit conversion of nil into Hash

Because the instance variables are nil.

The fix is to replace instance variable with protected attribute reader.

@TonyCTHsu TonyCTHsu requested a review from a team September 1, 2023 11:46
@TonyCTHsu TonyCTHsu added this to the 1.15.0 milestone Sep 1, 2023
@TonyCTHsu TonyCTHsu changed the title Fix tagging Fix tagging with empty data Sep 1, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #3102 (8131af7) into master (0318c77) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3102   +/-   ##
=======================================
  Coverage   98.15%   98.15%           
=======================================
  Files        1323     1323           
  Lines       75085    75094    +9     
  Branches     3421     3421           
=======================================
+ Hits        73702    73711    +9     
  Misses       1383     1383           
Files Changed Coverage Δ
lib/datadog/tracing/metadata/tagging.rb 97.61% <100.00%> (ø)
spec/datadog/tracing/metadata/tagging_spec.rb 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@TonyCTHsu TonyCTHsu merged commit 0e35673 into master Sep 4, 2023
@TonyCTHsu TonyCTHsu deleted the tonycthsu/fix-tags branch September 4, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tagging.rb giving me an undefined method 'merge' for nil::NilClass
4 participants