Skip to content

Commit 28a411b

Browse files
committed
Don't throw LocalAnalysisFailedException in LocalVariables.detectCurrentSettings
1 parent 41ff225 commit 28a411b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/kotlin/platform/mixin/util/LocalVariables.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ object LocalVariables {
392392
method: MethodNode,
393393
node: AbstractInsnNode,
394394
): Array<LocalVariable?>? {
395-
return getLocals(module.project, classNode, method, node, detectCurrentSettings(module))
395+
val settings = detectCurrentSettings(module) ?: return null
396+
return getLocals(module.project, classNode, method, node, settings)
396397
}
397398

398399
private fun getLocals(
@@ -410,9 +411,8 @@ object LocalVariables {
410411
}
411412

412413
private val resurrectLocalsChange = SemanticVersion.release(0, 8, 3)
413-
private fun detectCurrentSettings(module: Module): Settings {
414-
val mixinVersion = MinecraftFacet.getInstance(module, MixinModuleType)?.mixinVersion
415-
?: throw LocalAnalysisFailedException()
414+
private fun detectCurrentSettings(module: Module): Settings? {
415+
val mixinVersion = MinecraftFacet.getInstance(module, MixinModuleType)?.mixinVersion ?: return null
416416
return if (mixinVersion < resurrectLocalsChange) {
417417
Settings.NO_RESURRECT
418418
} else {

0 commit comments

Comments
 (0)