From 1f6e0f287d0aa64d133ac9588829259df27ed103 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Fri, 10 Dec 2021 13:13:31 +0000 Subject: [PATCH] Ensure the origin monitor is valid too Blurh, still not sure if this is Correct or anything, but have no clue what's causing this. Fixes #985. Hopefully. --- .../computercraft/shared/peripheral/monitor/Expander.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/Expander.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/Expander.java index 94aaf0d49..c99b05a0e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/Expander.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/Expander.java @@ -95,7 +95,10 @@ class Expander if( !isPositive ) { TileEntity otherOrigin = level.getBlockEntity( otherMonitor.toWorldPos( 0, 0 ) ); - if( otherOrigin == null || !origin.isCompatible( (TileMonitor) otherOrigin ) ) return false; + if( !(otherOrigin instanceof TileMonitor) || !origin.isCompatible( (TileMonitor) otherOrigin ) ) + { + return false; + } origin = (TileMonitor) otherOrigin; }