diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8c4a1368e..1dff57ad25 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,13 @@ # Contributing to sentry-java -We love pull requests from everyone. +We love pull requests from everyone. We suggest opening an issue to discuss bigger changes before investing on a big PR. # Requirements -The project currently requires you run JDK version `1.8.x`. +The project currently requires you run JDK 11. -## Android +## Android This repository is a monorepo which includes Java and Android libraries. If you'd like to contribute to Java and don't have an Android SDK with NDK installed, diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java b/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java index e744e20412..4b7d0cd7b5 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java @@ -231,18 +231,21 @@ static void applyMetadata( options.setProguardUuid( readString(metadata, logger, PROGUARD_UUID, options.getProguardUuid())); - SdkVersion sdkVersion = options.getSdkVersion(); - Objects.requireNonNull(sdkVersion, "Property options.sdkVersion must not be null."); - final String sdkVersionName = readString(metadata, logger, SDK_NAME, sdkVersion.getName()); - if (sdkVersionName != null) { - sdkVersion.setName(sdkVersionName); - } - final String sdkVersionVersion = - readString(metadata, logger, SDK_VERSION, sdkVersion.getVersion()); - if (sdkVersionVersion != null) { - sdkVersion.setVersion(sdkVersionVersion); + SdkVersion sdkInfo = options.getSdkVersion(); + if (sdkInfo != null) { + final String sdkName = readString(metadata, logger, SDK_NAME, sdkInfo.getName()); + if (sdkName != null) { + sdkInfo.setName(sdkName); + } + final String sdkVersion = readString(metadata, logger, SDK_VERSION, sdkInfo.getVersion()); + if (sdkVersion != null) { + sdkInfo.setVersion(sdkVersion); + } + options.setSdkVersion(sdkInfo); + } else { + // Should always be set by the Options constructor but let's error out if that changes. + Objects.requireNonNull(sdkInfo, "Property options.sdkVersion must not be null."); } - options.setSdkVersion(sdkVersion); } options