Skip to content

Commit 6a310df

Browse files
lcianmarkushi
andauthored
use Map.remove
Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
1 parent 5a62c9f commit 6a310df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry/src/main/java/io/sentry/util/LoggerPropertiesUtil.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ public static void applyPropertiesToEvent(
3030
final @NotNull Map<String, String> properties) {
3131
if (!targetKeys.isEmpty() && !properties.isEmpty()) {
3232
for (final String key : targetKeys) {
33-
if (properties.containsKey(key)) {
33+
@Nullable String value = properties.remove(key)
34+
if (value != null) {
35+
event.setTag(key, value);
36+
}
3437
event.setTag(key, properties.get(key));
3538
properties.remove(key);
3639
}

0 commit comments

Comments
 (0)