Prevent failure with null in List toObject
This commit is contained in:
parent
a6fe10e527
commit
dad8266837
|
@ -75,7 +75,7 @@ List.prototype.push = function (obj) {
|
|||
List.prototype.toObject = function (onlySchema, removeHidden) {
|
||||
var items = [];
|
||||
this.forEach(function (item) {
|
||||
if (item.toObject) {
|
||||
if (item && typeof item === 'object' && item.toObject) {
|
||||
items.push(item.toObject(onlySchema, removeHidden));
|
||||
} else {
|
||||
items.push(item);
|
||||
|
|
Loading…
Reference in New Issue