diff --git a/src/main/java/li/cil/oc2/common/bus/RPCAdapter.java b/src/main/java/li/cil/oc2/common/bus/RPCAdapter.java index cdbb2d24..43d24867 100644 --- a/src/main/java/li/cil/oc2/common/bus/RPCAdapter.java +++ b/src/main/java/li/cil/oc2/common/bus/RPCAdapter.java @@ -147,8 +147,12 @@ public final class RPCAdapter implements Steppable { if (synchronizedInvocation != null) { final MethodInvocation methodInvocation = synchronizedInvocation; - synchronizedInvocation = null; processMethodInvocation(methodInvocation, true); + + // This is also used to prevent thread from processing messages, so only + // reset this when we're done. Otherwise we may get a race-condition when + // writing back data. + synchronizedInvocation = null; } }