Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
- Nav3: Stop attributing errors and spans from an Activity or ViewPager2 page without a `SentryNavEffect` to the most recently visited Nav3 root ([#6483](https://github.com/getsentry/sentry-java/pull/6483))
- Android: Count deep sleep in breadcrumb, screenshot and view hierarchy debounce windows, so the first low-memory or battery breadcrumb after a long Doze is no longer dropped ([#6590](https://github.com/getsentry/sentry-java/pull/6590))
- Avoid duplicate serialization debug logs when calculating serialized object sizes ([#6255](https://github.com/getsentry/sentry-java/pull/6255))
- `Contexts.setProfile(null)` now removes the profile context instead of throwing ([#6684](https://github.com/getsentry/sentry-java/pull/6684))

### Dependencies

Expand Down
1 change: 0 additions & 1 deletion sentry/src/main/java/io/sentry/protocol/Contexts.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public void setTrace(final @NotNull SpanContext traceContext) {
}

public void setProfile(final @Nullable ProfileContext profileContext) {
Objects.requireNonNull(profileContext, "profileContext is required");
this.put(ProfileContext.TYPE, profileContext);
}

Expand Down
11 changes: 11 additions & 0 deletions sentry/src/test/java/io/sentry/protocol/ContextsTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.sentry.protocol

import com.google.common.truth.Truth.assertThat
import io.sentry.ProfileContext
import io.sentry.SpanContext
import kotlin.test.Test
Expand Down Expand Up @@ -149,4 +150,14 @@ class ContextsTest {

assertTrue(contexts.isEmpty)
}

@Test
fun `set null profile removes the previous profile context`() {
val contexts = Contexts()
contexts.profile = ProfileContext(SentryId())

contexts.profile = null

assertThat(contexts.profile).isNull()
}
}
Loading