Fix AIOOB exception in crash reporting if exception does not have a stack. Possible, but odd.

This commit is contained in:
LexManos 2013-06-10 01:25:25 -07:00
parent 031e7a5e7e
commit c1ba77eb3f

View file

@ -0,0 +1,12 @@
--- ../src_base/minecraft/net/minecraft/crash/CrashReport.java
+++ ../src_work/minecraft/net/minecraft/crash/CrashReport.java
@@ -253,7 +253,8 @@
StackTraceElement stacktraceelement = null;
StackTraceElement stacktraceelement1 = null;
- if (astacktraceelement != null && astacktraceelement.length - j < astacktraceelement.length)
+ int idx = astacktraceelement.length - j; //Forge fix AIOOB exception.
+ if (astacktraceelement != null && idx < astacktraceelement.length && idx >= 0)
{
stacktraceelement = astacktraceelement[astacktraceelement.length - j];