mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-25 02:54:21 +00:00
Only throw profiler stack exceptions when the profiler is active
This commit is contained in:
1 parent
4ebb6372f8
commit
82b6c5cfe6
1 file changed
+4
-2
@@ -637,7 +637,7 @@ public final class Profiler {
|
||||
void end(Section section) {
|
||||
try {
|
||||
for (Section head = this.stack.pop(), next = head; next != section; next = this.stack.pop()) {
|
||||
if (next == null) {
|
||||
if (next == null && this.active) {
|
||||
if (head == null) {
|
||||
throw new IllegalStateException("Attempted to pop " + section + " but the stack is empty");
|
||||
}
|
||||
@@ -645,7 +645,9 @@ public final class Profiler {
|
||||
}
|
||||
}
|
||||
} catch (NoSuchElementException ex) {
|
||||
throw new IllegalStateException("Attempted to pop " + section + " but the stack is empty");
|
||||
if (this.active) {
|
||||
throw new IllegalStateException("Attempted to pop " + section + " but the stack is empty");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user