Skip to content

Commit

Permalink
JamepadController: Prevent a stack overflow if a disconnected control…
Browse files Browse the repository at this point in the history
…ler is accessed by client from within disconnect
  • Loading branch information
MrStahlfelge committed Feb 3, 2020
1 parent fb1cb18 commit 03a8538
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ public String getName() {
}

private void setDisconnected() {
connected = false;
logger.info("Failed querying controller at index: " + controllerIndex.getIndex());
compositeControllerListener.disconnected(this);
if (connected) {
connected = false;
logger.info("Failed querying controller at index: " + controllerIndex.getIndex());
compositeControllerListener.disconnected(this);
}
}

@Override
Expand Down

0 comments on commit 03a8538

Please sign in to comment.