Skip to content

Commit 6da35a8

Browse files
committed
fix: don't try to call toArray() on arrays
1 parent 5eef8e1 commit 6da35a8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/decap-cms-core/src/backend.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,14 @@ export class Backend {
13841384
if (rawValue === null || rawValue === undefined) {
13851385
values = [];
13861386
} else if ((<StaticallyTypedRecord<List<string>>>rawValue).toJS) {
1387-
values = (<StaticallyTypedRecord<List<string>>>rawValue).toJS().toArray();
1387+
const valueList = (<StaticallyTypedRecord<List<string>>>rawValue).toJS();
1388+
1389+
if (valueList.toArray) {
1390+
values = valueList.toArray();
1391+
}
1392+
else {
1393+
values = valueList;
1394+
}
13881395
} else if (Array.isArray(rawValue)) {
13891396
values = <string[]>rawValue;
13901397
} else {

0 commit comments

Comments
 (0)