DEV: make pre-initializer a bit safer

Was noticing custom fields could be null is some cases so this ensures we
never reach to it if missing
This commit is contained in:
Sam Saffron 2019-10-30 17:55:50 +11:00
parent cbab25356b
commit 029a26733a
1 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,11 @@ export default {
"custom_fields.enable_unassigned_filter",
{
get(fieldName) {
// not sure how this is possible but appears to happen in some cases
// in test
if (!this && !this.custom_fields) {
return false;
}
return Ember.get(this.custom_fields, fieldName) === "true";
}
}