Skip to content

Commit

Permalink
Fix isHigherRole failing if one of the role is falsy
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz authored May 8, 2019
1 parent 9a454de commit 2e708e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Utility/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ class Utils {
* @memberof Utils
*/
isRoleHigher(role1, role2) {
if (!role1) {
return false;
}

if (role1 && !role2) {
return true;
}

return role1.position > role2.position;
}

Expand Down

0 comments on commit 2e708e5

Please sign in to comment.