Skip to content

Commit 951df34

Browse files
authored
fix: Initialize attributes dict in CocoaSDK::log unconditionally (#440)
1 parent 593e512 commit 951df34

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Fixed SentryLog.set_attribute() not working on Android ([#438](https://github.com/getsentry/sentry-godot/pull/438))
88
- Fixed occasional crash on exit on Android ([#439](https://github.com/getsentry/sentry-godot/pull/439))
9+
- Initialize attributes dict in CocoaSDK::log unconditionally ([#440](https://github.com/getsentry/sentry-godot/pull/440))
910

1011
### Dependencies
1112

src/sentry/cocoa/cocoa_sdk.mm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,8 @@
109109

110110
String body = p_body;
111111

112-
NSMutableDictionary *attributes = nil;
113-
112+
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithCapacity:p_attributes.size()];
114113
if (!p_attributes.is_empty()) {
115-
attributes = [[NSMutableDictionary alloc] initWithCapacity:p_attributes.size() + 1];
116-
117114
const Array &keys = p_attributes.keys();
118115
for (int i = 0; i < keys.size(); i++) {
119116
const String &key = keys[i];

0 commit comments

Comments
 (0)