From 6b09380eed0e8a5a8f92d42905b1b868fbb40d27 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sun, 21 Aug 2022 18:39:12 +0200 Subject: [PATCH] Set compile and target SDK to 33 --- .../src/main/java/de/mm20/launcher2/search/data/LocalFile.kt | 4 ++-- settings.gradle.kts | 4 ++-- .../java/de/mm20/launcher2/weather/LatLonWeatherProvider.kt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/files/src/main/java/de/mm20/launcher2/search/data/LocalFile.kt b/files/src/main/java/de/mm20/launcher2/search/data/LocalFile.kt index d8297eab..5c85322c 100644 --- a/files/src/main/java/de/mm20/launcher2/search/data/LocalFile.kt +++ b/files/src/main/java/de/mm20/launcher2/search/data/LocalFile.kt @@ -269,7 +269,7 @@ open class LocalFile( loc.indexOf('/') ).toDouble() val list = Geocoder(context).getFromLocation(lon, lat, 1) - if (list.size > 0) { + if (list != null && list.size > 0) { metaData.add(R.string.file_meta_location to list[0].formatToString()) } } @@ -290,7 +290,7 @@ open class LocalFile( val loc = exif.latLong if (loc != null && Geocoder.isPresent()) { val list = Geocoder(context).getFromLocation(loc[0], loc[1], 1) - if (list.size > 0) { + if (list != null && list.size > 0) { metaData.add(R.string.file_meta_location to list[0].formatToString()) } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 72d4e7b7..50844a80 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -37,8 +37,8 @@ dependencyResolutionManagement { versionCatalogs { create("sdk") { version("minSdk", "26") - version("compileSdk", "32") - version("targetSdk", "32") + version("compileSdk", "33") + version("targetSdk", "33") } create("libs") { version("kotlin", "1.7.10") diff --git a/weather/src/main/java/de/mm20/launcher2/weather/LatLonWeatherProvider.kt b/weather/src/main/java/de/mm20/launcher2/weather/LatLonWeatherProvider.kt index 930d3f78..6d80246e 100644 --- a/weather/src/main/java/de/mm20/launcher2/weather/LatLonWeatherProvider.kt +++ b/weather/src/main/java/de/mm20/launcher2/weather/LatLonWeatherProvider.kt @@ -38,7 +38,7 @@ abstract class LatLonWeatherProvider : WeatherProvider() CrashReporter.logException(e) emptyList() } - } + } ?: emptyList() return locations.mapNotNull { LatLonWeatherLocation( lat = it.latitude, @@ -72,7 +72,7 @@ abstract class LatLonWeatherProvider : WeatherProvider() return withContext(Dispatchers.IO) { try { Geocoder(context).getFromLocation(lat, lon, 1) - .firstOrNull() + ?.firstOrNull() ?.formatToString() ?: formatLatLon(lat, lon) } catch (e: IOException) { CrashReporter.logException(e)