Procházet zdrojové kódy

push to undefined fix

Ivan Asmer před 4 roky
rodič
revize
5368dfcf05
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      index.js

+ 3 - 1
index.js

@@ -212,7 +212,9 @@ const mm = db => {
 
                 if (!Savable.existsInArray(this[ourRelationName], ref)) {
                     this[ourRelationName].push(ref)
-                    this._id && this._loadRelations[ourRelationName].push(ref)
+                    if (this._id && this._loadRelations[ourRelationName] instanceof Array){
+                        this._loadRelations[ourRelationName].push(ref)
+                    }
                 }
 
                 query = {$addToSet: shortQuery}