Skip to content

Commit 3770f57

Browse files
authored
Probably fixed npe in raytrace #3891 (#3904)
1 parent 597ff11 commit 3770f57

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,13 @@ public PrimaryBoxData(boolean usePlacementGrid) {
229229
}
230230

231231
@Nullable
232-
static Direction traceCoverSide(BlockHitResult result) {
232+
static Direction traceCoverSide(@Nullable BlockHitResult result) {
233233
return determineGridSideHit(result);
234234
}
235235

236236
@Nullable
237-
static Direction determineGridSideHit(BlockHitResult result) {
237+
static Direction determineGridSideHit(@Nullable BlockHitResult result) {
238+
if (result == null) return null;
238239
return GTUtil.determineWrenchingSide(result.getDirection(),
239240
(float) (result.getLocation().x - result.getBlockPos().getX()),
240241
(float) (result.getLocation().y - result.getBlockPos().getY()),

0 commit comments

Comments
 (0)