Permalink
Browse files

Merge pull request #132 from jgoyon/fix/dry-run-on-first-migration-fails

Fix #82 dry-run-on-first-migration-fails
  • Loading branch information...
2 parents c0d9fa8 + f7f3523 commit fdb81b3a8d5910de08ae66438a266426daccef8f @kunklejr kunklejr committed Oct 8, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/driver/pg.js
View
@@ -57,7 +57,7 @@ var PgDriver = Base.extend({
return callback(err);
}
- if (result.rows && result.rows.length > 0 && result.rows[0].version) {
+ if (result && result.rows && result.rows.length > 0 && result.rows[0].version) {
var version = result.rows[0].version;
var match = version.match(/\d+\.\d+\.\d+/);
if (match && match[0] && semver.gte(match[0], '9.1.0')) {
@@ -70,7 +70,7 @@ var PgDriver = Base.extend({
return callback(err);
}
- if (result.rows && result.rows.length < 1) {
+ if (result && result.rows && result.rows.length < 1) {
this.createTable('migrations', options, callback);
} else {
callback();

0 comments on commit fdb81b3

Please sign in to comment.