From 3aa12281c3943d9cc91138080cf5bff0987bd70d Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 23 Feb 2020 21:51:55 -0500 Subject: [PATCH] Avoid crash on loading invalid extension (cherry picked from commit 460fbb18c73733a005bbab32996d5edfc7458a4a) --- .../eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt index c4018f046..7e3998d27 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionLoader.kt @@ -100,6 +100,12 @@ internal object ExtensionLoader { val versionName = pkgInfo.versionName val versionCode = pkgInfo.versionCode + if (versionName.isNullOrEmpty()) { + val exception = Exception("Missing versionName for extension $extName") + Timber.w(exception) + return LoadResult.Error(exception) + } + // Validate lib version val majorLibVersion = versionName.substringBefore('.').toInt() if (majorLibVersion < LIB_VERSION_MIN || majorLibVersion > LIB_VERSION_MAX) {