Skip to content

Improve top-level api safety#1162

Merged
st0012 merged 3 commits intomasterfrom
improve-api-safety
Dec 18, 2020
Merged

Improve top-level api safety#1162
st0012 merged 3 commits intomasterfrom
improve-api-safety

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@st0012 st0012 commented Dec 18, 2020

If the SDK is not initialized, the Sentry.get_current_hub will be nil, which will then cause NoMethodError when the user calls top-level APIs. This PR fixes this issue using the lonely operator.

If the SDK is not initialized, the Sentry.get_current_hub will be nil,
which will then cause NoMethodError when the user calls top-level APIs.

This commit fixes this issue using the lonely operator.
@st0012 st0012 added the bug fix label Dec 18, 2020
@st0012 st0012 added this to the 4.1.1 milestone Dec 18, 2020
@st0012 st0012 self-assigned this Dec 18, 2020
@codecov-io
Copy link
Copy Markdown

codecov-io commented Dec 18, 2020

Codecov Report

Merging #1162 (ff7d031) into master (5bb3971) will increase coverage by 0.48%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1162      +/-   ##
==========================================
+ Coverage   97.82%   98.30%   +0.48%     
==========================================
  Files         191       96      -95     
  Lines        7936     4139    -3797     
==========================================
- Hits         7763     4069    -3694     
+ Misses        173       70     -103     
Impacted Files Coverage Δ
sentry-ruby/lib/sentry-ruby.rb 98.70% <100.00%> (ø)
sentry-ruby/spec/sentry_spec.rb 100.00% <100.00%> (ø)
sentry-raven/spec/raven/logger_spec.rb
...lib/raven/integrations/rails/controller_methods.rb
sentry-raven/lib/raven/base.rb
sentry-raven/lib/raven/logger.rb
sentry-raven/spec/raven/transports/http_spec.rb
sentry-raven/lib/raven/core_ext/object/deep_dup.rb
sentry-raven/spec/raven/configuration_spec.rb
sentry-raven/spec/raven/linecache_spec.rb
... and 87 more

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 5bb3971...ff7d031. Read the comment docs.

@st0012 st0012 merged commit 8a1fedd into master Dec 18, 2020
@st0012 st0012 deleted the improve-api-safety branch December 18, 2020 17:26
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.

2 participants