Skip to content

Commit

Permalink
Update GDWheelPolicy.java
Browse files Browse the repository at this point in the history
A fix for null pointer in migrate.
changed the condition of the if statment as to not cause a null pointer exception by trying to access wheel at index that is out of bounds.
  • Loading branch information
himelbrand committed Apr 27, 2021
1 parent ba78559 commit 038153a
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -122,7 +122,7 @@ private void migrate(int level) {
clockHand[level] = hand;

// if C[idx] has advanced a whole round back to 1, call migration(idx+1)
if ((hand == 0) && (level < wheel.length)) {
if ((hand == 0) && (level + 1 < wheel.length)) {
migrate(level + 1);
}

Expand Down

0 comments on commit 038153a

Please sign in to comment.