Skip to content

Commit 70eb0d2

Browse files
committed
update null check location
1 parent 2fcfc95 commit 70eb0d2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/Envelope.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,8 @@ public double getSampleRate() {
139139
/**
140140
* Sets the SampleRate property.
141141
*/
142-
public void setSampleRate(Double value) {
143-
if (value != null) {
142+
public void setSampleRate(double value) {
144143
this.sampleRate = value;
145-
}
146-
147144
}
148145

149146
/**

core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseSampleSourceTelemetry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public void reset() {
1717
@Override
1818
protected void setSampleRate(Envelope envelope) {
1919
Double currentSP = getSamplingPercentage();
20-
envelope.setSampleRate(currentSP);
20+
if (currentSP != null) {
21+
envelope.setSampleRate(currentSP);
22+
}
2123
}
2224
}

0 commit comments

Comments
 (0)