Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 9227c02

Browse files
committed
Fix ModuleMode StackOverflowError
Caused when setState was called on a Mode that was already the active mode of it's parent.
1 parent cd1a587 commit 9227c02

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/clientapi/module/ModuleMode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public ModuleMode(T parent, String name, String description) {
6363
@Override
6464
public final void setState(boolean state) {
6565
parent.setState(state);
66-
parent.setMode(this);
66+
67+
if (parent.getMode() != this)
68+
parent.setMode(this);
6769

6870
if (state) {
6971
onEnable();

0 commit comments

Comments
 (0)