fix: Catch correct exception

This commit is contained in:
oSumAtrIX 2023-09-13 01:51:46 +02:00
parent 9a109c129b
commit 637d48746f
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -65,7 +65,7 @@ sealed class PatchBundleLoader private constructor(
internal fun Class<*>.getInstance(logger: Logger): Patch<*>? { internal fun Class<*>.getInstance(logger: Logger): Patch<*>? {
return try { return try {
getField("INSTANCE").get(null) getField("INSTANCE").get(null)
} catch (exception: NoSuchFileException) { } catch (exception: NoSuchFieldException) {
logger.fine( logger.fine(
"Patch class '${name}' has no INSTANCE field, therefor not a singleton. " + "Patch class '${name}' has no INSTANCE field, therefor not a singleton. " +
"Will try to instantiate it." "Will try to instantiate it."