Skip to content

Commit

Permalink
Merge pull request #16 from noiresonn/hotfix-HOTFIX_nullpointer_in_ge…
Browse files Browse the repository at this point in the history
…tfive

HOTFIX for the nullpointer exception in getFiveProfiles
  • Loading branch information
noiresonn authored May 10, 2017
2 parents f399d69 + 13720e5 commit 2c05904
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ public ArrayList<Profile> getFiveProfiles() {
* If either end is reached, it will skip that side
* The algorithm can be easily limited if the profile pool is huge
* */

/**
* If both ends have been reached, the roots will be reset
*/
if(maxRoot == null && minRoot == null) {
minnull = false;
maxnull = false;
maxRoot = profileTreeSet.higher(rootPreference);
minRoot = profileTreeSet.lower(rootPreference);
}

if(!minnull && !maxnull) {
/**
* Minroot is closer
Expand Down Expand Up @@ -212,15 +223,6 @@ public ArrayList<Profile> getFiveProfiles() {
minRoot = profileTreeSet.lower(minRoot);
}

/**
* If both ends have been reached, the roots will be reset
*/
if(maxRoot == null && minRoot == null) {
minnull = false;
maxnull = false;
maxRoot = profileTreeSet.higher(rootPreference);
minRoot = profileTreeSet.lower(rootPreference);
}
}
return profiles;
} else {
Expand Down

0 comments on commit 2c05904

Please sign in to comment.