Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

fix ContextBuilder.copyFrom NPE #15

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/main/java/com/launchdarkly/sdk/ContextBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ ContextBuilder copyFrom(LDContext context) {
anonymous = context.isAnonymous();
attributes = context.attributes;
privateAttributes = context.privateAttributes;
copyOnWriteAttributes = true;
copyOnWritePrivateAttributes = true;
copyOnWriteAttributes = context.attributes != null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Objects.nonNull(context.attributes)

copyOnWritePrivateAttributes = context.privateAttributes != null;
return this;
}

Expand Down