Skip to content

Commit

Permalink
Fixed Faulty Indexing
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sementsov <michael.sementsov@ibykus.de>
  • Loading branch information
MSementsov-Ibk committed Sep 28, 2018
1 parent c000151 commit 8f0f432
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ private PointCoordMap getBag( int i, Point p ) {
if (points.get(i - 1).point.equals(p)) {
return points.get(i - 1);
}
if (points.size() > i + 1 && points.get(i + 1).point.equals(p)) {
return points.get(i + 1);
if (points.size() > i && points.get(i).point.equals(p)) {
return points.get(i);
}
}
PointCoordMap bag = new PointCoordMap(p);
Expand Down

0 comments on commit 8f0f432

Please sign in to comment.