Context: handle getTargetSdkVersion() returning null

This commit is contained in:
Julian Winkler
2023-11-04 17:47:43 +01:00
parent 1cef28f086
commit 1aa1ee64c1

View File

@@ -88,7 +88,9 @@ public class Context extends Object {
InputStream inStream = ClassLoader.getSystemClassLoader().getResourceAsStream("AndroidManifest.xml");
try {
manifest = AndroidManifestBlock.load(inStream);
application_info.targetSdkVersion = manifest.getTargetSdkVersion();
Integer targetSdkVersion = manifest.getTargetSdkVersion();
if (targetSdkVersion != null)
application_info.targetSdkVersion = targetSdkVersion;
} catch (IOException e) {
e.printStackTrace();
}