Skip to content

Commit 830e57d

Browse files
authored
Avoid logging an error when a float is passed in the manifest (#4031)
1 parent 0bb5768 commit 830e57d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Avoid logging an error when a float is passed in the manifest ([#4031](https://github.com/getsentry/sentry-java/pull/4031))
8+
39
## 8.0.0
410

511
### Summary

sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,10 @@ private static boolean readBool(
475475
private static @NotNull Double readDouble(
476476
final @NotNull Bundle metadata, final @NotNull ILogger logger, final @NotNull String key) {
477477
// manifest meta-data only reads float
478-
final Double value = ((Number) metadata.getFloat(key, metadata.getInt(key, -1))).doubleValue();
478+
double value = ((Float) metadata.getFloat(key, -1)).doubleValue();
479+
if (value == -1) {
480+
value = ((Integer) metadata.getInt(key, -1)).doubleValue();
481+
}
479482
logger.log(SentryLevel.DEBUG, key + " read: " + value);
480483
return value;
481484
}

0 commit comments

Comments
 (0)