Skip to content

Commit

Permalink
nullability fix on application info
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Palacio committed Jul 12, 2024
1 parent 0a7713c commit 03976b3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ internal object DropboxAuthIntent {

fun Context.getTargetSdkVersion(): Int? {
return try {
val packageInfo: PackageInfo = packageManager.getPackageInfo(packageName, 0) ?: return null
val targetSdkVersion: Int = packageInfo.applicationInfo.targetSdkVersion
val packageInfo: PackageInfo = packageManager.getPackageInfo(packageName, 0)
val targetSdkVersion: Int? = packageInfo.applicationInfo?.targetSdkVersion
targetSdkVersion
} catch (e: Exception) {
null
Expand Down

0 comments on commit 03976b3

Please sign in to comment.