diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utils/math/BlockFinder.java b/app/src/main/java/com/eveningoutpost/dexdrip/utils/math/BlockFinder.java index daa4679324..51cbe0612b 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utils/math/BlockFinder.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utils/math/BlockFinder.java @@ -35,9 +35,14 @@ public String toString() { } public Block set(final int top, final int bottom) { - if (top < 0 || bottom < 0) return null; - this.top = top; - this.bottom = bottom; + if (top < 0 || bottom < 0) + { + this.top = 0; + this.bottom = 0; + } else { + this.top = top; + this.bottom = bottom; + } return this; } } @@ -107,7 +112,7 @@ public int findRandomAvailablePositionWithFailSafe(final int height, final int m } } // FailSafe - return new Random().nextInt(maxHeight); + return new Random().nextInt(bound); }