Added null checks

This commit is contained in:
tastybento 2020-11-14 12:02:48 -08:00
parent c0c9e16b6c
commit 19565e90ff

View File

@ -115,10 +115,10 @@ public class JoinListener implements Listener {
// Material limit // Material limit
ibc.setBlockLimit(m, Math.max(ibc.getBlockLimit(m), value)); ibc.setBlockLimit(m, Math.max(ibc.getBlockLimit(m), value));
} else { } else {
if (m.isBlock()) { if (m != null && m.isBlock()) {
// Material limit // Material limit
ibc.setBlockLimit(m, Math.max(ibc.getBlockLimit(m), value)); ibc.setBlockLimit(m, Math.max(ibc.getBlockLimit(m), value));
} else { } else if (et != null){
// This is an entity setting // This is an entity setting
ibc.setEntityLimit(et, Math.max(ibc.getEntityLimit(et), value)); ibc.setEntityLimit(et, Math.max(ibc.getEntityLimit(et), value));
} }