mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
check if data is array
This commit is contained in:
parent
4b80d9b224
commit
9259a4c504
@ -354,6 +354,11 @@ export default class SettingsMenu extends React.PureComponent {
|
|||||||
generateSettingsGroups = (data) => {
|
generateSettingsGroups = (data) => {
|
||||||
let groups = {}
|
let groups = {}
|
||||||
|
|
||||||
|
if (!Array.isArray(data)) {
|
||||||
|
console.error("Cannot generate settings groups from non-array data")
|
||||||
|
return groups
|
||||||
|
}
|
||||||
|
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
if (!groups[item.group]) {
|
if (!groups[item.group]) {
|
||||||
groups[item.group] = []
|
groups[item.group] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user