From 3eb2a52d9b476f1ca690dc95b1671bd7d627e193 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 14 Jun 2023 11:08:23 -0800 Subject: [PATCH] fix: avoid inserting a nil into the gpu data dictionary literal (#3092) --- CHANGELOG.md | 1 + Sources/Sentry/SentryProfiler.mm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2d88e8e01e..e04b404a96b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Duplicated HTTP breadcrumbs (#3058) - Expose SentryPrivate and SentrySwiftUI schemes for cartahge clients that have `--no-use-binaries` option (#3071) - Convert last remaining `sprintf` call to `snprintf` (#3077) +- Fix a crash when serializing profiling data (#3092) ## 8.7.4 diff --git a/Sources/Sentry/SentryProfiler.mm b/Sources/Sentry/SentryProfiler.mm index 1e1c707d4c6..899ff4f7e65 100644 --- a/Sources/Sentry/SentryProfiler.mm +++ b/Sources/Sentry/SentryProfiler.mm @@ -143,7 +143,7 @@ @"value" : obj[@"value"], }]; }]; - if (useMostRecentRecording && slicedGPUEntries.count == 0) { + if (useMostRecentRecording && slicedGPUEntries.count == 0 && nearestPredecessorValue != nil) { [slicedGPUEntries addObject:@ { @"elapsed_since_start_ns" : @"0", @"value" : nearestPredecessorValue,