aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/core/util')
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java3
1 files changed, 3 insertions, 0 deletions
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();
}