mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensures validValues is an array (#13435)
Before this fix the setting object would have exceptions on 3 fields: computedNameProperty, computedValueProperty and validValues
```
TypeError: Cannot read property 'forEach' of undefined
at Class.validValues (http://localhost:4200/assets/admin.js:10468:19)
at Class.<anonymous> (http://localhost:4200/assets/vendor.js:82492:19)
at http://localhost:4200/assets/vendor.js:28633:34
at untrack (http://localhost:4200/assets/vendor.js:26641:7)
at ComputedProperty.get (http://localhost:4200/assets/vendor.js:28632:13)
at Class.CPGETTER_FUNCTION [as validValues] (http://localhost:4200/assets/vendor.js:26259:25)
at Class.r (<anonymous>:1:83)
```
This commit is contained in:
@@ -50,7 +50,7 @@ export default Mixin.create({
|
||||
const vals = [],
|
||||
translateNames = this.translate_names;
|
||||
|
||||
validValues.forEach((v) => {
|
||||
(validValues || []).forEach((v) => {
|
||||
if (v.name && v.name.length > 0 && translateNames) {
|
||||
vals.addObject({ name: I18n.t(v.name), value: v.value });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user