Skip to content

RUMS-5893: Fix NPE when SeekBar thumb is null#3419

Merged
jonathanmos merged 1 commit into
developfrom
dd/fix-seekbar-null-thumb-crash
May 13, 2026
Merged

RUMS-5893: Fix NPE when SeekBar thumb is null#3419
jonathanmos merged 1 commit into
developfrom
dd/fix-seekbar-null-thumb-crash

Conversation

@nguyexua
Copy link
Copy Markdown
Contributor

@nguyexua nguyexua commented May 5, 2026

What does this PR do?

Workflow Automation • View in Workflow Automation

Fixes a crash in Session Replay seek bar mapping when SeekBar.thumb is null by safely skipping thumb wireframe creation. Adds a unit test to verify we still return track wireframes when the thumb is missing.

Motivation

Some SeekBar instances can have a null thumb drawable. The existing mapper unconditionally accessed view.thumb.bounds, which could throw a NullPointerException during recording.

Changes

  • Added a null guard in SeekBarWireframeMapper.buildThumbWireframe() to return early when view.thumb is null.
  • Reused the resolved non-null thumb instance for bounds access.
  • Added SeekBarWireframeMapperTest coverage for the {null thumb, Android O+} case, asserting mapping returns only active/non-active track wireframes.

Testing

  • Ran ktlint --format --reporter=json on changed Kotlin files via the lint tool (no issues).
  • Attempted to run ./gradlew :features:dd-sdk-android-session-replay:testDebugUnitTest --tests "*SeekBarWireframeMapperTest" but execution is blocked in this sandbox because Gradle wrapper download failed with java.net.NoRouteToHostException.

Additional Notes

This change is intentionally scoped to the Session Replay module and does not alter privacy behavior or public APIs.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

PR by Bits - View session in Datadog

Comment @DataDog to request changes

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented May 5, 2026

View session in Datadog

Bits Dev status: ✅ Done

Comment @DataDog to request changes

@nguyexua nguyexua requested review from a team as code owners May 5, 2026 10:16
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown
Contributor

I can only run on private repositories.

@nguyexua nguyexua marked this pull request as draft May 5, 2026 10:17
0xnm
0xnm previously approved these changes May 5, 2026
kikoveiga
kikoveiga previously approved these changes May 5, 2026
Co-authored-by: nguyexua <lan.nguyen@datadoghq.com>
@jonathanmos jonathanmos dismissed stale reviews from kikoveiga and 0xnm via 1b9e534 May 12, 2026 07:31
@jonathanmos jonathanmos force-pushed the dd/fix-seekbar-null-thumb-crash branch from 31d4eb2 to 1b9e534 Compare May 12, 2026 07:31
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.06%. Comparing base (cbd94a0) to head (1b9e534).
⚠️ Report is 22 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3419      +/-   ##
===========================================
- Coverage    72.18%   72.06%   -0.12%     
===========================================
  Files          961      961              
  Lines        35407    35408       +1     
  Branches      5880     5881       +1     
===========================================
- Hits         25557    25514      -43     
- Misses        8258     8282      +24     
- Partials      1592     1612      +20     
Files with missing lines Coverage Δ
...internal/recorder/mapper/SeekBarWireframeMapper.kt 95.65% <100.00%> (+0.10%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos jonathanmos marked this pull request as ready for review May 13, 2026 08:17
@jonathanmos jonathanmos changed the title Fix NPE when SeekBar thumb is null RUM-5893: Fix NPE when SeekBar thumb is null May 13, 2026
@jonathanmos jonathanmos changed the title RUM-5893: Fix NPE when SeekBar thumb is null RUMS-5893: Fix NPE when SeekBar thumb is null May 13, 2026
@jonathanmos jonathanmos merged commit 0ba6850 into develop May 13, 2026
26 checks passed
@jonathanmos jonathanmos deleted the dd/fix-seekbar-null-thumb-crash branch May 13, 2026 08:29
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.

5 participants