Skip to content

Commit

Permalink
Make eq-by helper resilient to a lack of prop since handlebars doesn'…
Browse files Browse the repository at this point in the history
…t short-circuit evaluation
  • Loading branch information
DingoEatingFuzz committed Aug 7, 2020
1 parent 7dde9ab commit 950c2bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/app/helpers/eq-by.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { helper } from '@ember/component/helper';
* Returns true when obj1 and obj2 have the same value for property "prop"
*/
export function eqBy([prop, obj1, obj2]) {
if (!obj1 || !obj2) return false;
if (!prop || !obj1 || !obj2) return false;
return get(obj1, prop) === get(obj2, prop);
}

Expand Down

0 comments on commit 950c2bd

Please sign in to comment.