From 13b79706b6eddef6118453bf51782ad01b3e8328 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 9 Jan 2022 17:49:52 +0000 Subject: Partially implemented Computer Cube. Fix Multis wanting Mufflers when pollution = 0. Fix getMethodName potentially crawling too far up the stack. --- src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/gtPlusPlus/core/util') diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 1ef925f793..aaec2024e4 100644 --- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -335,6 +335,9 @@ public class ReflectionUtils { public static String getMethodName(final int depth) { final StackTraceElement[] ste = new Throwable().getStackTrace(); //System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName()); + if (ste.length < depth) { + return "No valid stack."; + } return ste[depth+1].getMethodName(); } -- cgit