mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 04:00:30 +00:00
Fix NPE when pulling an event with no type
I assume people have broken coroutine dispatchers - I didn't think it was possible to queue an actual event with no type. See cc-tweaked/cc-restitched#31. Will fix it too once merged downstream!
This commit is contained in:
parent
3eab2a9b57
commit
47ad7a35dc
@ -98,7 +98,10 @@ public final class MethodResult
|
||||
{
|
||||
Objects.requireNonNull( callback, "callback cannot be null" );
|
||||
return new MethodResult( new Object[] { filter }, results -> {
|
||||
if( results.length >= 1 && results[0].equals( "terminate" ) ) throw new LuaException( "Terminated", 0 );
|
||||
if( results.length >= 1 && Objects.equals( results[0], "terminate" ) )
|
||||
{
|
||||
throw new LuaException( "Terminated", 0 );
|
||||
}
|
||||
return callback.resume( results );
|
||||
} );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user