Avoid potential NPE when merging events.
RELNOTES: None
@@ -890,12 +890,9 @@ public final class Profiler {
// Returns a TaskData object representing the merged data and clears internal data structures.
TaskData getAndReset() {
TaskData ret;
- if (count <= 1) {
+ if (data == null || count <= 1) {
ret = data;
} else {
- if (data == null) {
- ret = data;
- }
ret =
new TaskData(
data.threadId,
