Skip to content

Commit 4a51e42

Browse files
fix: remove fallback dates, no report if nil
1 parent 5a52d3b commit 4a51e42

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/Observability/AutoInstrumentation/Launch/LaunchMeter.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,14 @@ public final class LaunchMeter {
167167
state.lastLaunchDuration = currentUptime - (state.lastWillEnterForegroundTime ?? 0.0)
168168
state.launchType = .warm
169169

170+
guard
171+
let lastWillEnterForegroundDate = state.lastWillEnterForegroundDate,
172+
let launchEndUpDate = state.launchEndUpDate
173+
else { return }
174+
170175
let statistics = LaunchStats(
171-
startTime: state.lastWillEnterForegroundDate ?? Date(),
172-
endTime: state.launchEndUpDate ?? Date(),
176+
startTime: lastWillEnterForegroundDate,
177+
endTime: launchEndUpDate,
173178
elapsedTime: state.lastLaunchDuration,
174179
launchType: state.launchType
175180
)

0 commit comments

Comments
 (0)