Fixed NPE when events are triggered within events (#1574)
This commit is contained in:
1 parent
ab9f7992b7
commit
2b5e51b4df
1 file changed
+2
-1
@@ -223,7 +223,7 @@ public class CarpetEventServer
|
|||||||
{
|
{
|
||||||
if (callList.size() > 0 && CarpetServer.scriptServer != null)
|
if (callList.size() > 0 && CarpetServer.scriptServer != null)
|
||||||
{
|
{
|
||||||
return CarpetServer.scriptServer.events.handleEvents.runIfEnabled( () -> {
|
Boolean isCancelled = CarpetServer.scriptServer.events.handleEvents.runIfEnabled( () -> {
|
||||||
CarpetProfiler.ProfilerToken currentSection = CarpetProfiler.start_section(null, "Scarpet events", CarpetProfiler.TYPE.GENERAL);
|
CarpetProfiler.ProfilerToken currentSection = CarpetProfiler.start_section(null, "Scarpet events", CarpetProfiler.TYPE.GENERAL);
|
||||||
List<Value> argv = argumentSupplier.get(); // empty for onTickDone
|
List<Value> argv = argumentSupplier.get(); // empty for onTickDone
|
||||||
CommandSourceStack source;
|
CommandSourceStack source;
|
||||||
@@ -266,6 +266,7 @@ public class CarpetEventServer
|
|||||||
CarpetProfiler.end_current_section(currentSection);
|
CarpetProfiler.end_current_section(currentSection);
|
||||||
return cancelled;
|
return cancelled;
|
||||||
});
|
});
|
||||||
|
return isCancelled != null && isCancelled;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user