DEV: Ensure getter can always return without error (#18621)
Normally, arguments passed to components are lazily evaluated. `get prefixElementColors` will only be evaluated for `@prefixType="span"`. However, when using the Ember Inspector in development, arguments are eagerly evaluated and their values displayed in the inspector. Therefore we need to make sure that getters can always be evaluated without exceptions being thrown.
This commit is contained in:
parent
4b4dbbf580
commit
731c625042
|
@ -52,6 +52,10 @@ export default class SectionLink extends Component {
|
|||
}
|
||||
|
||||
get prefixElementColors() {
|
||||
if (!this.args.prefixElementColors) {
|
||||
return;
|
||||
}
|
||||
|
||||
const prefixElementColors = this.args.prefixElementColors.filter((color) =>
|
||||
color?.slice(0, 6)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue