Skip to content
Browse files

Merge pull request #178 from brunogonncalves/master

resolve #177.
  • Loading branch information...
2 parents 899c529 + f43e2d8 commit f692c4eb554a4d5f289eb8f19614e501fae9de76 @zefhemel zefhemel committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/persistence.store.sql.js
View
8 lib/persistence.store.sql.js
@@ -391,9 +391,11 @@ function config(persistence, dialect) {
}
}
var additionalQueries = [];
- for(var p in meta.hasMany) {
- if(meta.hasMany.hasOwnProperty(p)) {
- additionalQueries = additionalQueries.concat(persistence.get(obj, p).persistQueries());
+ if(meta && meta.hasMany) {
+ for(var p in meta.hasMany) {
+ if(meta.hasMany.hasOwnProperty(p)) {
+ additionalQueries = additionalQueries.concat(persistence.get(obj, p).persistQueries());
+ }
}
}
executeQueriesSeq(tx, additionalQueries, function() {

0 comments on commit f692c4e

Please sign in to comment.
Something went wrong with that request. Please try again.